domain: Fix double-exit on nested domains

Minor oversight in fix for #4953.