add getRNGState and setRNGState functions to get/set the state of random
number generator. These provide the ability to replay a sequence of
random numbers from a given arbitrary point in time.

This commit provides the same capability as pull request #129
(https://github.com/andresy/torch/pull/129)
silence warnings about implicit cast
Merge remote-tracking branch 'andresy/master' into andresy
Merge branch 'andresy'