ocl: workaround for subbuffer memory leaks
Merge pull request #1756 from alalek:ocl_workaround_memory_leaks_with_subbuffer