add logic for master to write a pidfile

# notes

I tried to place the logic in `bud.c` right above the call to `uv_run` but the ended up confused as to why there are 2 calls to `uv_run`... either way i've tested this and it seems to work as expected.
You should call `write()` here in a loop like in libuv: https://github.com/joyent/libuv/blob/master/src/unix/fs.c#L455-L457