Add capacity-reserving functions for Vec and VecMap

Part of #18424

Inspired by #19216

Adds functions for reserving capacity to Vec & VecMap, as per the collections reform. Also adds a capacity() function to VecMap.

The build fails the evec-in-struct debuginfo-gdb test (in my build environment at least), and I have no idea why. I asked around on IRC and Reddit, but didn't get a response.