Add logs around database flushing

From sugar-web unit tests it seems to be taking 5 seconds some
times. Let's see if it's really spending the time there.