fixed pidfile handling to check for a lock on the file, so we can be