create pid directory and ensure propper ownership