Cleanup:Use get_type()instead of get_header().type

Cleanup the code ,use get_type() instead of get_header().type
for messages.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
Merge pull request #3112 from xiaoxichen/cleanup_getheader

Cleanup:Use get_type()instead of get_header().type

Reviewed-by: Loic Dachary <ldachary@redhat.com>