Fix for validating PID permissions

File.writable? will always return false for a non existing file, thus it's
better to check the parent directory to see if we can write a PID file.