Potential fix for bug44604: Reviki 0.3.1 keeps locking a CPU and falling over

Explicitly close the repository connections created when searching
for the repository path that a page belonged to at a particular
revision.

This is a potential fix for:
https://bugs.corefiling.com/show_bug.cgi?id=44604