Clean up after curl download failure & retain CWD when entering chroot

Signed-off-by: Juha Kallioinen <juha.kallioinen@jollamobile.com>