configure: Reorder pthreads checks

Some pthreads symbols might be present in libc (as shown on various *BSD)
but not all of them, leading to false positives.

Check for the most common compiler flags before the plain symbol check
to avoid known pitfalls.
