function ensureDirectoryExists(dir) {
  return stat(dir).catch(() => mkdir(dir, { recursive: true }));
}
Ensures the given path exists.
 - If the path already exist, it's fine - it does nothing.
 - If the path doesn't exist, it will create it.

@param {string} path
@returns {Promise}