Upgraded CuBLAS to API V2.

- more consistant error checking
- one cublas handle per GPU
Move global RNG state into cutorch table.

Create a new struct for cutorch's global state, THCudaState, currently
only containing the global RNG state, THCudaRNGState.
All RNG methods take the state as their first argument.