MB-8030: Create upper directories if necessary

Change-Id: Iee007474e9aba59f726e20d0c0ba655c494af842