[DatabaseIO] Only mark rows as read when they are currently unread.

There's no sense endlessly marking things as read. This doesn't scale when the
database continues to grow, and has proven slow on some devices.

At least on one such device, the time for updating ~6k rows went from >1s of
system time (and a lot of sluggishness, thanks to btrfs) down to ~40ms.

Reported-by: Andrea Bernabei <and.bernabei@gmail.com>
Debugged-with: ^