Better thread safety tests.

The `let` blocks of Rspec cache the return values after the initial call and
don't use any kind of locking system, as a result they are not thread safe.