Expose new threadWaitSTM functions in Control.Concurrent (see #7216).

Supports threadWaitReadSTM and threadWaitWriteSTM on Windows with the threaded runtime system.
Fix warnings
Fix ambiguity error on Windows

I assume that we only want to catch IOExceptions, as withThread does.
Fix warnings on Windows