Flush the writer under all circumstances when we are terminating.