Fix some of the open file issues with Torch
Fix some of the open file issues with Torch

When running the image classification model tests like this:

    ./digits-test digits/model/images/classification/test_views.py

the number of open files for the test suite grows to > 900.
You can verify this with:

    while :; do lsof -p $PID | grep tmp | wc -l; sleep 1; done

where PID is the process ID of the test suite.

This patch brings the number of open files down from > 900 to ~90.
There's more work to be done to fix this completely, but this takes a
big step in the right direction.

NOTE: I can't actually run the whole testsuite or I get a bunch of these
OSErrors:

    OSError: [Errno 24] Too many open files

gheinrich/DIGITS-GAN,batra-mlp-lab/DIGITS,Lucaszw/DIGITS,ethantang95/DIGITS,TimZaman/DIGITS,Lucaszw/DIGITS,jmancewicz/DIGITS,brainstorm-ai/DIGITS,batra-mlp-lab/DIGITS,ethantang95/DIGITS,gheinrich/DIGITS-GAN,gheinrich/DIGITS-GAN,bygreencn/DIGITS,Deepomatic/DIGITS,jmancewicz/DIGITS,TimZaman/DIGITS,brainstorm-ai/DIGITS,dongjoon-hyun/DIGITS,bygreencn/DIGITS,ethantang95/DIGITS-GAN,batra-mlp-lab/DIGITS,bygreencn/DIGITS,ethantang95/DIGITS-GAN,dongjoon-hyun/DIGITS,Deepomatic/DIGITS,dongjoon-hyun/DIGITS,jmancewicz/DIGITS,ethantang95/DIGITS,brainstorm-ai/DIGITS,Deepomatic/DIGITS,ethantang95/DIGITS-GAN,ethantang95/DIGITS-GAN,batra-mlp-lab/DIGITS,dongjoon-hyun/DIGITS,brainstorm-ai/DIGITS,ethantang95/DIGITS,Lucaszw/DIGITS,TimZaman/DIGITS,Lucaszw/DIGITS,TimZaman/DIGITS,gheinrich/DIGITS-GAN,Deepomatic/DIGITS,jmancewicz/DIGITS,bygreencn/DIGITS