virt-alignment-scan: Add checks for when API calls return NULL.