fix off-by-one error in db line cache

Signed-off-by: Doug Hellmann <doug.hellmann@gmail.com>