fix memory leaks introduced by invalid gettext usage