Prevent Matlab on OS X from crashing on error

Replace CHECK() and LOG(FATAL) with LOG(ERROR) and mexErrMsgTxt

A failed CHECK() or LOG(FATAL) causes Matlab to crash on OS X 10.9 with Matlab 2014a.
Merge pull request #1406 from CellScope/matcaffe-osx-fix-crash-on-error

Prevent Matlab on OS X from crashing on error