testsuite: Fix mkdir_p corner cases

 - Fix infinite loop when path is relative
 - Fix not considering EEXIST as a success
 - General refactor to mkdir_p so it never calls mkdir for an existing
   dir (given no one creates it from outside)
util: Add mkdir_p implementation from testsuite
static-nodes: don't fail if modules.devname not found

In containers/VM's/initrd one might not have installed any modules and
accompanying modules.devname Don't fail if this is the case, just warn.

When used in systemd this means we don't get a failing unit on booting
containers.
util: Add len arg to mkdir_p()
util: Add mkdir_parents()

Like mkdir_p, but discards the leaf, creating the parent directories.
static-nodes: create parent directories of output file

Allows us to drop call to "mkdir -p" from the systemd service file.