Modifications to liblibc for raw/custom socket support.
auto merge of #16844 : mrmonday/rust/liblibc-custom-socket, r=alexcrichton

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.