Bug fix: makedirs didn't handle symlinks

If /var/cache didn't exist and /var was a symlink, you'd get:

Not a directory: /var
... creating directory /var/cache/0install.net/implementations

Reported by Anil Madhavapeddy.