purge: prevent a silly crash with --confirm --files

if --files is passed, there was no directory to checks and `msg` was undefined.
This is now fixed and tested.
14 jobs for topic/stable/fix-purge in 51 minutes and 50 seconds (queued for 6 seconds)