Fix upload

Make upload work when TMP_DIR points to /tmp (or is unset) and instances directory is on another device.