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.
Merge pull request #951 from gcinbis/patch-1

Lock the mex file to avoid MATLAB crashes
[fix] lint causing travis failures
Add Net::Reset and Layer::Reset methods.

Net::Reset calls Layer::Reset on all its layers.
Layer::Reset currently has a trivial implementation only; should be
impelmented for data layers.
Solver: call Reset on the test nets if specified by a new
SolverParameter field: test_net_reset.
Implement DataLayer::Reset()
Implement HDF5DataLayer::Reset()
Implement ImageDataLayer::Reset()
Implement DummyDataLayer::Reset() -- die on non-constant data.
Die on WindowDataLayer::Reset -- always uses RNG.