Refactoring/tidying of socket and related code.

Use unique_ptr to manage mcurlconn, timer and other helper lifetimes.
This reduces the size and complexity of the cleanup code, and reduces the
likelihood of leaks/memory misuse.
No longer use connpool to pool mcurlconn-derived objects, not necessary
when libcurl multi IO does connection pooling already.
Reduce use of bare pointers, use observer_ptr for clarity in a few places.
Use an incrementing connection ID instead of a pointer for debug logging.
Change socket manager connection list from a forward_list to a vector.
Few misc style fixes.
Whitespace and various misc style fixes.

Fix indentation and general whitespace.
Replace some iterator for loops with range for.
Move some initialisers out of constructors.
Remove some empty/redundant constructors/destructors.
Use nullptr instead of 0.
Fix a few minor type mismatches.