Reorganized kernel caches in spmat.hpp and stencil.hpp

Moved kernel caches from static class members into local static
variables. This allows Intel OpenCL SDK not to crash at program exit.