BUG-1949 Fix race condition in AsyncSshHandler