Avoid mistaking pid and configuration directories for files

Using [_File.exist?_](http://ruby-doc.org/core-2.1.0/File.html#method-c-exist-3F) instead of [_File.file?_](http://ruby-doc.org/core-2.1.0/File.html#method-c-file-3F) gives a false-positive result when the path argument is a directory (such as _._) instead of a file. This happens if the pid file path is its default value (_._).