glocalfile: Only use O_DIRECTORY if available

Solaris 10 for example doesn't have it.

https://bugzilla.gnome.org/show_bug.cgi?id=708860