Let write_pid_file() terminate if the pid file can't be opened