in Caffe::SetDevice, call cudaSetDevice before Get

Otherwise initialization will be performed on whichever device is
default.
Merge pull request #507 from longjon/set-device-early

Fix Caffe::SetDevice to avoid initializing on default device