replace all memset with caffe_set() / caffe_gpu_set()

...except for `SyncedMem` since it has no type.