Handle invalid or empty pid files instead of returning pid 0

If the pid file is empty or contains non-numeric data, this function returns 0. That means an empty pid file results in a test for `kill(0, 0)` which always returns true, preventing Daemons from restarting a process that has failed in this way.