Detach textures and fbs using a range check.

This is more compatible with the attach logic, and might also be faster.
Although, framebuffer destroys should not be that common.
For now, don't bind mismatched FBs at all.

But still don't create a garbage texture either.
Don't use render-to-texture with format mismatch.
Fix a possible memory leak in BlockDevices.cpp.
Fix table checks in sceCcc.

Was checking for the wrong table.
Fix bounds check in sceKernelPrintf().

Wasn't allowing a string ending in %08x.
Merge pull request #3076 from unknownbrackets/ccc

Fix table checks in sceCcc.
Merge pull request #3073 from thedax/headlessBuildFix

Fix headless build error and abstract OSK bypass.
Merge pull request #3072 from lioncash/master

Fix a possible memory leak in BlockDevices.cpp.
Shouldn't be necessary to flush on drawsync.
Fix threadsafe event removal.
Use threadsafe events for GE communication.

Hopefully this doesn't cause problems again for 3rd Birthday or FF Type-0.
Kinda need it.
Schedule ts events using the same time frame.
Treat savestates specially, no longer using events.

This makes it easier to run them on the GPU thread anyway, which is best
if they reset GPU caches etc., and should remove any timing related
issues.
Get rid of CoreTiming::AdvanceQuick().

It basically existed for savestates, so no longer needed.
Fixes issues with events not running when they should.
Enable interrupts as a property of the list.

This way there's no behavior change when enqueue is async.
Merge pull request #3029 from unknownbrackets/render-fb

Use a null texture for incorrect render-to-texture + delete better
Merge pull request #3075 from unknownbrackets/gpu-thread

Prep work for GE and CPU on separate threads
Windows UI: Fix some UI bugs and move more magic numbers to an enumerator.
Missed an enter/return.