tty/n_gsm.c: fix a memory leak when gsmtty is removed