Stop __index__ and __newindex__ leaking a tensor during torch.test()

This change fixes leaks that occur during the tests - but not all possible leaks from `__index__` and `__newindex__`

Any `luaL_argcheck` after this line:

>  tensor = THTensor_(newWithTensor)(tensor);

Will cause tensor to leak.

There are ~8 other `luaL_argcheck` lines across these two functions which the tests don't hit that will do this - is it worth fixing them?