fix many memory leaks
using valgrind, these changes eliminate all cases of leaking memory caused by explicitly by osk-sdl (~50MB in a quick test)
using valgrind, these changes eliminate all cases of leaking memory caused by explicitly by osk-sdl (~50MB in a quick test)