fix R session crash when returning from top-level debug