Fixed file checks in FileSystem and Sqlite handlers.

This PR introduces consistency between the FileSystem and Sqlite handlers regarding their checks on the filesystem, as well as adding an additional check to more clearly report the difference between a non-directory file living at the filepath and any other types of directory-creation failure.