Initial set of warning fixes

* Ensure we use `socklen_t` where we should.
* Fix sequence-point safety on `RESIZE()` macro.
* Fix some unused variable logic errors.