Try to cleanup repositories in case of build failure

taken from https://github.com/CyanogenMod/hudson/commit/2d20509ed1b026e1c6076099484192cbc11f4f15