Add flycheck-root-directory-p

Add function to determine if a directory is the root directory in a more platform-neutral way.