test-hashmap: use ALLOC_ARRAY rather than bare malloc