Fix some crashes, OpenGL context sharing, and other minor changes

The only unifying theme in these changesets is that they were all made as part of my effort to get example1 and helloworld to run correctly and without crashing when building with GDC 4.9.0 with SDL and OpenGL on the back-end.

It would be nice to get some feedback about how these work out with other compilers and runtime configurations, as well as to hear back a little on what the plans are for achieving thread safety.

One minor annoyance is that `src/dlangui/core/i18n.d` had mixed line-ending types. Maybe a [read of this piece](https://help.github.com/articles/dealing-with-line-endings) would prove useful.