tbm_surface_internal: fix the memory leak