Better handling connect errors such as econnrefused

Test is provided and simple patch.
Without it lhttpc just fails with error if remote socket is closed