domains: Handle errors thrown in nested error handlers

If a domain error handler throws, it should be caught if it was
in a stack of nested domains.

Fix #4953