Implement some of the popular socket APIs left unimplemented for SGX, following the merge of dev/socket.