Refactor: crmd: improve generation of node state
This refactor simplifies do_lrm_query_internal(). It is now static, loses the
long-unused is_replace argument, and gets a new argument update_flags. This
allows its backward-compatibility hack for older DCs to be moved to
do_lrm_query(), which should be the only place that needs it. Some code
duplication is avoided by using existing functions.
This also removes the header declaration for the long-gone create_node_state()
function.