Add a waittype registry to handle callbacks right.
Handle waits inside semaphore waits properly.
sceKernelWaitSemaCB() should run callbacks first.

Patapon 2 gets back to the menu with this.
Make mutexes handle callbacks better + before.

Mutex and semaphores (but NOT lwmutexes) call callbacks before attempting
the lock, but only if it would not generate errors.

Have not yet tested other wait types.
Fix waits within waits for lwmutexes.

Also, it turns out sceKernelLockMutexCB() doesn't call callbacks on lock.
These are actually okay, happen on the second cb.
Merge pull request #1110 from unknownbrackets/callbacks

Improve callbacks with waits