Merge r262341:
  - Improve logging of send errors, reporting error code and interface.
  - Reduce code duplication between INET and INET6.