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
default backend to lmdb for image conversion and mean computation

lmdb is 10-15% faster than leveldb although it takes ~1.1x the storage.
This is usually irrelevant in prefetching since both are fast enough,
but more important lmdb allows multiple, concurrent reads for training
and evaluation several models on the same data.
fix cifar10 paths so they can be run from caffe root
switch examples to lmdb (except for custom data loaders)
Merge pull request #1128 from shelhamer/default-db-lmdb

default to lmdb for database storage
adds a parameter to the LRN layer (denoted as "k" in  [Krizhevsky et al., NIPS 2012])
added support for "k" LRN parameter to upgrade_proto
added matcaffe_demo for the VGG models (RGB input)
added comments to the Matlab demo script
added example usage to the Matlab script
RGB -> BGR in the matlab demo
Changed "blas" to "openblas"

The change was made because openblas has to be linked as "-lopenblas" and not "-lblas". This caused an error when compiling.
added a Matlab demo with mean BGR pixel subtraction instead of the mean image subtraction
Fixed param order of cv::Size in cv::resize
Merge pull request #1152 from sguada/fix_cv_size_order

Fix param order of cv::Size in cv::resize
Back-merge

  Fixed param order of cv::Size in cv::resize
  switch examples to lmdb (except for custom data loaders)
  fix cifar10 paths so they can be run from caffe root
  default backend to lmdb for image conversion and mean computation
Merge pull request #1138 from ksimonyan/vgg_models_support

VGG models support
Merge pull request #1147 from savy-91/patch-1

Changed "blas" to "openblas"