use the block in a thread in the jruby monkeypatch

fixes #21