Proper directory_map test skip

* added the needed trailing backslash
* use is_dir() instead of opendir() as it doesn't throw error on failure
Simplify directory_map test skip
Merge pull request #2541 from vlakoff/develop-4

Proper directory_map test skip