[libcontacts] Prevent crash in coalescing import contacts. Fixes JB#12291