Use rspec-mocks' new temporary scope support for the sandboxing.

Historically, this sandboxing logic has been brittle. Using
built-in rspec-mocks public APIs will be less brittle.