Lock the mex file to avoid Matlab crashes.

Commands like "clear all" and "clear function" causes segmentation faults or errors like these (especially after an 'init'):
 libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe/proto/caffe.proto
 libprotobuf FATAL google/protobuf/descriptor.cc:862] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
 [libprotobuf ERROR google/protobuf/message.cc:333] Type appears to be in generated pool but wasn't registered: caffe.LayerParameter
 Attempt to restart MATLAB?
To avoid these, lock the the mex file.
Display averaged loss over the last several iterations
fix warning
remove a wrong space in common.hpp
[fix] check and load weight for backward w.r.t. data

fix NULL pointer when back-propagating to the data for fixed i.e. not
back-propagated weights. same issue as #1048
[pycaffe] fix comment typo
Merge pull request #1096 from qipeng/smoothed-cost

Display averaged loss over the last several iterations
[fix] solver indexing of output blobs was incorrect for non-singleton
outputs
Merge pull request #1203 from jeffdonahue/fix-output-blob-indexing

[fix] solver indexing of output blobs was incorrect for non-singleton outputs
Back-merge branch 'master' into dev (for fix in PR #1203)
caffe.proto: do some minor cleanup (fix comments, alphabetization)
Merge pull request #951 from gcinbis/patch-1

Lock the mex file to avoid MATLAB crashes
[fix] lint causing travis failures
Update detect.py

This generator causes an error in detect_windows because it is run twice there.
Better store it as a data structure instead.
Merge pull request #1198 from dbbert/patch-1
Back-merge to include #1198
[pycaffe] expose Net::CopyTrainedLayersFrom as Net.copy_from

This allows finetuning from Python, for example.
[pycaffe] expose Net::SharedTrainedLayersWith as Net.share_with