Add in support for pidfile

Includes a @tmpdir@ override for building