[lthread] Use ptr since memory is alloc by lthread

//thanks @araq