upgrade: More robust upgrade of STOS

First download all necessary files to disk, sync() and then move them
all into place at once