Fix Emacs lockup if mouse clicking in REPL with REPL thread busy