Lower the time spent scanning lastseen DB.

The total DB access time will thus not depend on the time spent running the callback (it seems to be huge in the case of reverse DNS resolution).

This commit makes it easier to later convert the scan into an RDONLY operation.