properly write the pid (not 0) to the pidfile in single fork mode (GH#49)

The pid in the pid file was "0" in single fork mode -- it looks like it was never being written after it was being cleared out.