Fallback to lstat, if the non-portable dirent.d_type is not available.

Bug-Debian: http://bugs.debian.org/695604
Bug-Ubuntu: https://bugs.launchpad.net/bugs/672643
Fix formatting as per review.
Merge pull request #2 from xnox/bug-695604

Fallback to lstat, if the non-portable dirent.d_type is not available.