Implement getpeername and getsockname

I have an implementation of this ready to go pending the outcome of the IPv6 pull request.