MB-100 Move ensure_dir{s,} functions to misc.

Change-Id: Iaa9b151c3fba1cf68c4acdcfbda79889252b934a
Reviewed-on: http://review.couchbase.org/29076
Tested-by: Aliaksey Artamonau <aliaksiej.artamonau@gmail.com>
Reviewed-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>