Clean up test_print_event_header()
Clean up test_print_event_header()

There were a couple warnings flagged by coverity on
test_print_events_header(). The function now checks for error
conditions flagged by PAPI_get_cmp_opt() and also frees memory
allocated by a calloc() function.

Signed-off-by: William Cohen <7ad90ad7035ff1d5b2ddada0aaffa89765886b13@redhat.com>

pyrovski/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,arm-hpc/papi,arm-hpc/papi,pyrovski/papi,pyrovski/papi,arm-hpc/papi,pyrovski/papi