Huh, that's really interesting. I think the conclusion has to be that it's a bug in the module, but I bet it's a bug in most modules using fork. I think the short-term workaround is to check the PID, as you've done, and the long-term fix is to evangelize module authors to use exit instead of die to fail.