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`)
We're currently marking these with `#[unstable = "matches collection reform specification, waiting for dust to settle"]`