Refactor: tools: functionize working set logic in crm_resource
This adds two new functions, update_working_set_xml() and update_working_set_from_cib(),
to separate code that will be needed by the planned --wait option. As part of the
refactoring, an error message previously sent to stdout is now correctly sent to stderr.