Refactor: libpacemaker: Add pcmk__get_ticket_state.
This function is used to grab the ticket_state XML for a given ticket, or potentially all tickets. And then, convert the two places we had this function to use the new one.