Modifications to liblibc for raw/custom socket support.

These are the additions to liblibc required for raw/custom socket support. I've broken this into a separate pull request due to the upcoming I/O overhaul (was originally part of pull #15741).

cc @alexcrichton.