sysdb: Fixed check for duplicate history entries.
sysdb: Fixed check for duplicate history entries.

current_history() returns the currently *selected* history entry. Rather, we
want the latest entry, that is, the one added last.

sysdb/sysdb,tokkee/sysdb,tokkee/sysdb,tokkee/sysdb,sysdb/sysdb,sysdb/sysdb