Fix errors found by cppcheck

* using delete instead of delete[] for array allocated with new[]
* potential memleak in tga_load