app/testpmd: fix memory leak on detach