bugfix: close the filehandle once done with downloading a repo

Signed-off-by: Dominik Richter <dominik.richter@gmail.com>