Pid file mgmt

This is an alternative the to recently merged change to deal with pid file management, which addresses concerns about cases where pids are reused by other users' processes.