Testing keyboard listener in a thread