In particular, address a couple instances where GNO's sockets implementation doesn't comply with modern standards. Also, add a few missing prototypes so we can use ORCA/C prototype-checking lint functionality.