5990: Properly undefine the domain

If the domain has managed save images or snapshots, a regular call to undefine will fail. The appropriate flags must be set in order to properly undefine it.