cib: move CIB writing functionality from CIB daemon to CIB library
The non-daemon-specific portion of cib/io.c:write_cib contents()
has been refactored as the internally exposed function
lib/cib/cib_file.c:cib_file_write_with_digest() and its
subordinate static functions cib_file_backup() and cib_file_prepare_xml().