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

Fixes running libnih & upstart on XFS filesystem (and others that don't implement dirent.d_type)

Bug-Debian: http://bugs.debian.org/695604
Bug-Ubuntu: https://bugs.launchpad.net/bugs/672643