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
test_gradient_based_solver.cpp: removed unused typedefs
make HDF5 layer support multiple data output
added test case to cover new HDF5 behavior
Merge pull request #1183 from pluskid/hdf5layer
hdf5_data_layer.cpp: fix indentation
Cleanup HDF5DataLayer log messages.

-Only use "DLOG" during Forward/Backward for less noise during
training/testing
-Cleanup spacing, capitalization, etc.
Die on failure to load HDF5 data file.
HDF5DataLayer: die on failure to open source file
hdf5_load_nd_dataset_helper: check that dataset exists first
Merge pull request #1191 from jeffdonahue/hdf5data-cleanup

HDF5DataLayer cleanup
fix cuDNN build by readding line deleted in #1167
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