Ensure the directory we are writing to exists.