Fix ensure_dir: allow dots in directory names