detect folders (GCC only)

GCC4.9 on OSX reports some folders have a large file size. LLVM/Clang
does not show this effect. Patch correctly discriminates folders.