std::at_vec: Fix segfault on overflow when resizing ~[@T]

Easy to reproduce:

    let mut v = ~[@1];
    v.resize(-1);  // success a.k.a silent failure
    v.push(@2); // segfault
std::num: Add uint::next_power_of_two_opt

An Option<uint> that returns None on overflow.