Check if directories exist before uploading

If the directories to which we upload the maintenance file doesn’t exist, the task fails without any helpful explanation. It’s probably obvious when you think about it, but I did spend quite some time tracking down the reason for the failure.

To get rid of this «bug», the task should test if the directories exist before attempting to upload the file, and create them if necessary.