fixup unit tests for sdl 2.0

The idea here is to make it safe to detach the worker thread. We
replace the scoped pointer for the game_controller with a shared
pointer, and pass this to the worker thread. This way the worker
won't segfault if main thread times out and decides to return.

In SDL 2.0.2, Detach thread becomes available. I haven't tested
on the new version of SDL, but my understanding from posix
is that detached threads will simply run separately, until the
time that the main thread returns, at which point they will
be terminated.

I added compiler checks so that if Detach thread is not available,
the compiler will simply disable unit test timeouts, but otherwise
keep unit tests available.