Close jsdom rather than disposing its context directly.

If we don't go through the window.close interface then jsdom doesn't get
a chance to tear down timers, which means that the timers keep running
after the context is disposed and end up ultimately causing segfaults
and other such crashes.

This also gives jsdom a chance to cleanly shut down and do its work to
ensure we don't leak memory.