libpfctl: Improve error handling in pfctl_get_states()
Ensure that we always free nvlists and other allocated memory.
Reviewed by: scottl
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30493