better path checking when attempting to write the config

Will only do the tempfile dance if the config already exists and needs to be overwritten.

Otherwise it will make sure that `/etc/ceph` exists and then write the new config, else it will raise the appropriate error message about why it could not write the config file.