added functions to free data structures in libptp