Fixed rename and delete repository (issue-10)
This was due to use of the FileResolver which caches repository objects.
Calling close() on a cached repository instance would decrement a
counter, but the repository would never really close and release all its
resources because the FileResolver "held" the first count/reference so
the object and refs databases were never closed.
The solution was to use reflection to determine the actual "useCnt" of
the repository and then call close() that number of times. In practice,
the "useCnt" is probably always 2, and that is the default value in case
reflection fails.