Fix various memory leaks in transport-helper.c