To avoid the problem of processes exiting before cleaning up, one could do the following: after the child has created its PID file, the child should lock the PID file. The lock will be gone as soon as the process exits - no matter what the reason of exiting is (well, I'm assuming a UNIX OS, I've no idea how other OSses work). To check whether a previous child is still running, open the PID files, and try to get a lock. If you can get a lock, the process is no longer running. Only if the file exists, and it's still locked, the process is still running.
It also solves the problem of PID reuse.