Restore cout flags after changing them