Use properly resolved target for auto mkdir.

The code that automatically created the target directory was still using a
simple path.join() rather than the resolver.