Fix a build error on linux platforms

Due to dl* function usage in Core/HW/atrac3plus.cpp on non-windows
platforms, Core library needs to be linked with -ldl flag on these
platforms.

Added a CoreExtraLibs variable in CMakeLists.txt to handle all
platform-dependent dependencies of Core, and added dl to this variable
on non-win32 platforms.
Use CMAKE_DL_LIBS instead of dl
Modified the dl link flag to linux platform only
Return correct errors on terminating thread.

Fixes Final Fantasy 4 hangs when playing videos a second time.
Correct envelope scaling in sas mixing.

Sound effects seem a bit loud, but this matches what JPCSP does and I've
added comments based on my understanding of it.  It makes sense.

This makes all the sounds that never get muted when the envelope hits 0 go
away.  Hurray.

Thanks to help from @i1x.
Validate parameters in sceSasInit().
Don't restart release on double keyoff.

Fixes Kingdom Hearts bug, #2066.
Delay in sceSasCore per tests.

Not sure if this fixes anything, but scheduling issues can be tricky.
Revert #1974, the other fixes are better.

This is no longer needed for games I have, and it breaks Final Fantasy
Tactics' sound effects.

Looking at JPCSP for insight, I saw that it re-enables loops if you set a
voice even with a different address (I think?) but that seems strange.
Merge pull request #2184 from unknownbrackets/thread-funcs

Return correct errors on terminating thread
Merge pull request #2185 from unknownbrackets/sas-minor

Correct envelope scaling in sas mixing
Merge pull request #2186 from unknownbrackets/sas-minor2

Add some error handling in sceSas, delay sceSasCore()
Add a better signal for VRAM copies in the GPU.
Clear currentRenderVfb_ when fbo_unbinding.

At least, not doing this caused glitches somewhere else, seems right.
Fix memcpy to framebuffer to not invalidate.

This is much better.
Merge pull request #2187 from unknownbrackets/fbo-update

Update the framebuffer directly on sceDmacCopy()
We can't use S2 or D1. Use alternative means.
Merge pull request #2124 from chaserhkj/linux-fix

Fixed a build error on non-win32 platfroms
Use Button X to Confirm option also changes osk select and delete buttons
Merge pull request #2202 from evilcorn/master

Use Button X to Confirm option changes osk select and delete buttons