libticalcs: fix a double free reported by aeTIos in the Nspire OS sending code, and a nearby memory leak while at it.

It's unbelievable the double free never aborted the program for me since r4447, more than 10 months ago... in that timeframe, several OS transfers failed, so they did exercise the faulty code path !

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>