Reorder a few statements in Connection constructor

First check for valid arguments, then assign instance attributes, and do
all this in the same order as the arguments are specified in the
constructor signature.
Move Thrift object creation to helper method