Create output directories if they do not exist.