Move struct stat checks in configure

Tests for POSIX_C_SOURCE value need to be done before any actual checks