Change write_pid_file()'s prototype to take the path as argument