configure: Check for nanosleep in headers as well, not only in libs

On mingw64 with c++11 support, the link libraries do contain a
nanosleep function, while it isn't exposed via the headers. Using
check_func_headers instead of a plain check_func fixes this
misdetection.

Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
See: [FFmpeg-devel] [PATCH] fix: 'make' with mingw32
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
