Merge pull request #1756 from alalek:ocl_workaround_memory_leaks_with_subbuffer