fixes for OpenCL memory leak