Refactor thread end/delete a bit.
Use a waitingThreads list for threadend.

The timeout wasn't being correctly written before, actually.
Properly cancel waits in sceUmd.
Use a waiting thread list in sceGe as well.
Remove __KernelTriggerWait(), no longer used.
Silence a minor warning.
Always specify retval when resuming a thread.
Add callback wait handlers for threadend as well.
Merge pull request #3695 from unknownbrackets/threadend

Improve threadend waits, add callback handlers, some cleanup