Add test_threaded_with

This fails against the current dev branch parent (without thread-safe
branch).
Merge branch 'thread-safe-test' into thread-safe