Fix db_rollback integrity violation.

If some test case explicitly close database connection teardown fixture
doesn't clean those changes.
Use internal cache connection cursors rather global one.
Use cache connection as context manager.

Don't commit changes manually.
Allow to modify existed url_cache records.

Use keyword arguments in sql query substitution.
Download cached but not stored external libraries.