[caffe2] update make_mnist_db and make_image_db to move strings into DB::Put() (#60919)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60919
Update make_mnist_db.cc and make_image_db.cc to work with the DB API changes
in D29204425 (https://github.com/pytorch/pytorch/commit/00896cb9ed931bb816cf1a5e5f13ddc6b229378b). This is similar to the changes to make_cifar_db.cc landed in
D29374754 (https://github.com/pytorch/pytorch/commit/394f60b0fcd834bd2613a482b28408f275c0022b).
ghstack-source-id: 132621346
Test Plan: buck build caffe2/binaries/...
Reviewed By: valmikir
Differential Revision: D29447314
fbshipit-source-id: 33aff85c24d8b785211287de23d46704c7eb0726