PERF: improvements to random number generation in OpenCL backend

- Change incorrect macro check "T == double" to IS_DOUBLE
- Added try catch block around cl.hpp calls in random.hpp
- format changes to program.*