Correctly free repo on error

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Use DeleteFile() instead of CFile::Remove() to avoid exception

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>