Fix boundary cases in logspace() and linspace()

For any a < b:
torch.linspace(a, a, 1) returns a 1-dim tensor of a, instead of nan
torch.linspace(a, b, 1) throws an error, instead of returning nan
torch.logspace(a, a, 1) returns a 1-dim tensor of 10^a, instead of nan
torch.logspace(a, b, 1) throws an error, instead of returning nan
torch.test() checks the 4 asserts above
Merge pull request #101 from fidlej/topic_xpcall

Reported the full traceback on a test failure.
Merge pull request #100 from jucor/LinspaceFix

Fix boundary cases in logspace() and linspace()
THDiskFile: workaround insane Mac OS X fread bug ID# 6434977.
luajit: last changes from Mike Pall
DiskFile: removed restrict keyword
make tensor.expand create a tensor from correct type, not default type.
add referenced function to disable/enable indexing/referencing behaviour of the writeObject mechanism.
reverse logic on referenced
add isReferenced function to querry the referenced state