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.
Move declaration to the top and assign the value here.