Add capacity() to VecMap

Part of #18424

Adds `capacity()` function to VecMap, as per the collections reform.

(Salvaged from #19516, #19523, while we await an RFC regarding `reserve`/`reserve_index` for `VecMap`)
Shouldn't be an assert_eq. Allocator or implementation details are technically allowed to give us more than we ask for. Need to check `map.capacity() >= 10`