Use directory for pid

This makes it easier to give the process permissions to write the pid
file