Add support for some sockioctls.

Resolves #876 (except for wifi-specific ioctl that I couldn't have hit.)