Added optional custom debugger close handling