Add a unit test for cleaning up EGL's thread state
This adds a unit test for EGL cleaning up its thread state if a thread terminates with a current context, or if a thread with a current context is still around.
By itself, the test can only really check for whether something crashes, but valgrind or similar can find any leaks as well.