Paranoid implementation of pid file creation