Added is_writable checks to pid file locator.