Backport of "hacks: Fix unlinking of Android NDK directories if install fails midway" into 1.22
Backport of !1264 (merged) "hacks: Fix unlinking of Android NDK directories if install fails midway".
Commits:
- 3273d057 hacks: Fix unlinking of Android NDK directories if install fails midway