build/create-image.sh: fix cleanup called before MDIR is set