Create output directory if needed.