Fix a race condition in nailgun_task.py

When forking to spawn a ng daemon, and writing the pidfile, it was possible
for the append of the port number (by the parent) to precede the writing
of the pid (by the child). The child would then overwrite the port number,
leaving an invalid pidfile.

Auditors: markcc