Hardcore hacks for temporarily redirecting input of a background thread.