ensure load_connection_file works after self.session is created

Only write to config if self.session hasn’t been instantiated, otherwise write to session attrs.

closes #5853