clara images: fix umount_chroot to check if the partition is mounted *inside* the chroot
move atexit.register call after work_dir has been declared

also make sure filesystem are unmounted before trying to remove the chroot directory