__index__ and __newindex__ can leak a tensor if it reports a lua error. This change only fixes leaks that occur during the tests.
Merge pull request #15 from timharley/master

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