Empty the surrounding agent’s pending mutation observers when notifying
mutation observers according to the spec. Also, the code in the method
MutationObserver::queue_a_mutation_record and the corresponding
specification have diverged over the years. These changes bring the code
into conformity with the specification.
Testing: Added a new crash test
Fixes: #39434#39531
---------
Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>