Fixed allocating enough space for sockname/peername when using IPv6

Thanks @geertj for the patch!