Switch to file descriptors instead of FILE *.

This allows us to support the io modes more accurately, not truncating for create/write, etc.
Attempt to virtually handle truncation properly.

Fixes LittleBigPlanet save problem, at least on US.
Improve error handling when PARAM.SFO can't read.
Fix stack overflow on x64 with memchecks, darn it.
Use the resize event to update screen size on Qt.

Fixes #5491.
Merge pull request #5454 from unknownbrackets/io-minor

Improve truncation handling on all platforms
Merge pull request #5489 from unknownbrackets/jit-minor

Fix stack overflow on x64 with memchecks, darn it
Correct SAS bent linear curve.

Tests shows that at 0x30000000 it still goes up the full amount.
Run tests with the max volume set.
Don't change height immediately on keyon.

This replicates the PSP's behavior, which is a 32-grain lead in, plus the
height remains what it was before until processing happens.
Validate the effect volume in __sceSasRevEVOL().
Return an error for invalid voice in keyoff.

Can't reproduce no error and Every Extend Extra doesn't even seem to be
reporting it.  Most likely it would be happy with the error code anyway.
Don't change height when keying off a voice.

Tests show that the height does not revert to the sustain level.
Validate the sas noise freq parameter.
Fix the default adsr sustain mode.

Probably doesn't matter, games always set it.
Fix PCM looping in SAS.

The parameter specifies where the loop restarts at.
Don't loop PCM samples when loopPos < 0.
Don't read the first 32 samples after keyon.

The way I'm approximating this is ugly...