Fix monitor deadlock on panic