vec::with_capacity: do one alloc for non-managed
ptr: optimize {swap,replace,read}_ptr
auto merge of #7682 : thestinger/rust/vec, r=pcwalton

f74250e r=huonw

```rust
extern mod extra;

use std::vec;

#[bench]
fn bench_with_capacity(b: &mut extra::test::BenchHarness) {
    do b.iter {
        let _v: ~[u8] = vec::with_capacity(1024);
    }
}
```

Before:

`test bench_with_capacity ... bench: 293 ns/iter (+/- 0)`

After:

`test bench_with_capacity ... bench: 125 ns/iter (+/- 3)`