Create missing directories before writing certpair.