MNIST demo with lmdb (addresses issue 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.

./train_consolidated_mnist.sh now trains to completion. The final test error 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