util: Helper to create sets and hashes with pointer keys