configure: Use headers in the check for _beginthreadex for w32threads

When targeting the metro API subset, this function still exists in
the link libraries, but is excluded from the headers. This makes
sure w32threads is automatically disabled when targeting this API
subset (since not all the necessary functions for it are available).

Signed-off-by: Martin Storsjö <martin@martin.st>
