thcrap: log_flush: get real
thcrap: log_flush: get real

I have noticed that spinlocking on log_queue is what causes
thcrap_loaded and thcrap_configure_v3 to never exit, even if you call
ExitProcess directly. ExitProcess will call thcrap.dll DllMain which
will then hang due to spinlocking on log_queue. I think the reason for
that is that ExitProcess terminates the log thread before calling
DllMain, therefore spinlocking on log_queue always hangs because there's
no log_thread to read the last entry in the log_queue. But for some
reason this doesn't happen in debug mode...

thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap,thpatch/thcrap