Fix crash-on-osx-on-shutdown bug. And cleanup CDB handling in Rewrite.
Fix crash-on-osx-on-shutdown bug. And cleanup CDB handling in Rewrite.

cinnamoncoin/groupcoin-1,coinkeeper/2015-06-22_18-41_ixcoin,cinnamoncoin/groupcoin-1,cinnamoncoin/groupcoin-1,FrictionlessCoin/iXcoin,coinkeeper/2015-06-22_18-41_ixcoin,coinkeeper/2015-06-22_18-41_ixcoin,cinnamoncoin/groupcoin-1,FrictionlessCoin/iXcoin,FrictionlessCoin/iXcoin,cinnamoncoin/groupcoin-1,coinkeeper/2015-06-22_18-41_ixcoin,cinnamoncoin/groupcoin-1,FrictionlessCoin/iXcoin,coinkeeper/2015-06-22_18-41_ixcoin,FrictionlessCoin/iXcoin