MNIST demo with lmdb (addresses issues 922 and 958)

The MNIST demo now supports both lmdb (default) and leveldb. The choice of backend can be set in create_mnist.sh as a command line parameter for convert_mnist_data.bin. 

Writing examples individually to the lmdb backend is literally 100x slower than using batches, so now convert_mnist_data.cpp resembles convert_imageset.cpp a lot more closely in that batch writes are used for leveldb and lmdb.

./examples/mnist/train_lenet_consolidated.sh runs to completion. The final test accuracy is 99.7883%.

Commit ac9646c among other things removes a bug that is currently in the tip of the dev branch.
- examples/mnist/create_mnist.sh, l.10-11: missing path to db folders ($EXAMPLE) in rm -rf command
Update examples/mnist/lenet_train_test.prototxt for the lmdb source too.