[Torch] Use a scratch buffer in nn.Linear to reduce memory allocation

This reduces the amount of memory allocations in `Linear:updateOutput` and `Linear:accGradParameters`, and is lazily initialized for backwards compatibility.