Fixes issue #749.

Implements the missing `stopContext()` hook to match the existing `startContext()`