[FIX] test_cursor: new contextmanager to reset the lock during a sub_request