Changed basic_socket::task to have exclusive access to its own data