cherrypick and adapt 1.3 fold hardening
Merge pull request #641 from basho/pevm-leveldb-fold-hardening-1.4

leveldb fold hardening for 1.4