API: libpacemaker: Add a function for getting ticket state
This is the same functionality as "crm_ticket -q", but in a pair of public and private functions.
Ref T119