Switch to posix test for whether a path is a directory.