The new macro
dbg:with-debugger-wrapper
executes code with a specified function bound as a "debugger wrapper" which takes effect if the code gets an error and tries to invoke the debugger.
Your wrapper function can do whatever is needed, such as locking entry to the debugger in order to prevent multiple processes entering the debugger at once.