Implement Hash/PartialEq/Eq for TrieMap and TrieSet

cc #15294