Check for errors from clEnqueueReadBuffer and clEnqueueWriteBuffer