Avoid symbol collisions and warnings in the c++ driver

The C++ driver of mongodb contains the symbol md5_init which is also available in other c++ libraries (e.g. http://www.washington.edu/imap/). This can cause very strange and hard to debug segmentation faults. Therefore, I renamed the md5_* functions in mongo to mongo_md5_*.
Moreover, I fixed some warnings by adding static_casts to the code.