Only write pid to file if it has been forked to the background