After a sync connection, make sure to clear connect_data since it will otherwise point to a structure on the stack.