Contacts: Backport filename sanitation and blacklist checking to stable4.