Fix freezes with the dummy graphics context

Aborting the main thread of the dummy window might leave a lock active in
OpenTK which causes all future operations on the dummy context to fail.

We were aborting the main thread in the first place because we didn't want
it to keep the application open. Made it a background thread now instead.