Dispatch thread fixes

Fixes #339.  Can't find any games that it breaks, although it makes a number of changes.

Planning to move the HLE checks to the jit since that way, but it's not really important now.  It may make a few games a bit slower at the moment though (ones that hammer HLE funcs to death.)

There's more to fix: this just does mutexes and semaphores, which are all I've tested so far.

-[Unknown]