Change tcp_socket.rs and udp_socket.rs so that they no longer get linted

The lint for ~[T] was warning about a couple of lines, leading to the need for `#[allow(deprecated_owned_vector)]`.  This uses a different method to wrap up raw pointers as vectors, so the lint doesn't complain any more.