Context.exit() needs to be called on the same thread that calls Context.enter()