2e019b2fd1
To fix #4825 GFX functions must now aquire a lock before accessing surfaces. This prevents simultaneous update of internal data by client and gfx threads. Also enforce return value checks, where not already done.