Revert "db.cpp: improve performance"

This reverts commit 9a832fa4b010420990578e18dd0753e9d13366b6.
db.cpp: improve performance (cleaner)

Only flush database files every 2 / 5 minutes. wallet.dat is always
flushed.
Change db flags.