Update MetadataManager.py

When looking for repository, restore cwd *before* returning from method.
This bug currently results in the output path being relative to the directory of the input file, rather than the cwd of the invocation.