libdaemon pidfile fixes and cleanup