Merge https://github.com/2ndforks/torch7-distro into upstream (thread-safe rand)