MDL-48556 backup: Use correct conditions before checking dir permissions
MDL-48266 backup: Validate backup_auto_storage config
MDL-48266 backup: Fix backup strorage misconfiguration

Basically if the destination dir is empty then the storage
type should be set to the course backup area. This does
not affect the behaviour of the backups that lived with
misconfigured settings.