Fix Linux compile errors

_GNU_SOURCE should be defined before anything else.