Support socket operations via the `.socket` attribute on fds

Implements #1