fix bug in throw_and_clear_sdl_error