configure: detect if tdestroy is declared
tdestroy may be linking, but it's not always defined properly.
In the mingw-w64 of my Debian tdestroy is found but not declared.
And it fails to compile later.
That should also fix the tdestroy detection in emscripten.