extract: small bugfix and refactoring for parent dir creation
extract: small bugfix and refactoring for parent dir creation

make_parent(path) helper to reduce code duplication.
also use it for directories although makedirs can also do it.

bugfix: also create parent dir for device files, if needed.

RonnyPfannschmidt/borg,raxenak/borg,edgimar/borg,edgimar/borg,RonnyPfannschmidt/borg,RonnyPfannschmidt/borg,raxenak/borg,edgewood/borg,edgewood/borg,RonnyPfannschmidt/borg,raxenak/borg,edgimar/borg,raxenak/borg,RonnyPfannschmidt/borg,edgewood/borg,edgewood/borg,edgimar/borg