MDL-45654 cron: fix non-empty directories deletion

Remove errors when attempting to delete non-empty directories when
child directories do not get removed since the mtime was updated when
files were removed from the child directory.
Merge branch 'MDL-45654-master' of https://github.com/rtcn2/moodle