Check the parameters to SDL_UpdateTexture()
Fixed off-by-one error in SDL_ConvertStereo().

Fixes Bugzilla #561.

--HG--
extra : rebase_source : a21159567a0a8a9485c46d4c67e57224948952a0
Fixed bug 1946 - OpenGL contexts in threads

The SDL OpenGL context code is now properly thread aware.  There are two new functions which return the current OpenGL window and context for the current thread.

There are still places in the cocoa driver where the OpenGL context needs to be updated when the view changes.  These will need a different solution and still use the last globally set context to avoid changing behavior.