don't use cursors in threaded code, they're not thread-safe
fix traceback hack in `threaded_map()`
fix test