SWIG interface update for Random methods sample and shuffle.

See numenta/nupic.core#197
That is what is being caught here since that is the only scenario in which the C++ function throws a `LoggingException`.