Add a more descriptive exception for errors in sdl/gl code

  Instead of a single "invalid argument" exception, now it generates:

"null dereference" for null arguments that must be a valid pointer
"type mismatch" for an invalid type
"out of bounds" when out of bounds would happen
"invalid argument" for invalid numeric values or properties

  Note that it must check before it happens for null dereference and
out of bounds, because receiving a SIGSEGV is a fatal non recoverable
error.