Close connection to sail when publishing model