Tests if a given path resolves to a directory.