Fix a few places where we forgot to close the text codecs (#4029)