Tests: make it easier to test another module.

Less boilerplate needed.
Remove all created directories during creation check.

When checking if the backup script will be able to create a path,
remove all created directories.  Until now, only the final directory
was removed, and not any created parent directories.