Fixed issue #1552: TGitCache prevents a git clone from performing successfully

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Correctly free memory

Signed-off-by: Sven Strickroth <email@cs-ware.de>
TGitCache: Fail faster if files are too small

Also prevent allocation of 0 length memory.

Signed-off-by: Sven Strickroth <email@cs-ware.de>