Fix the add API for the hash table.

In case an existing key is being readded to the table, updated the
previous value in the table instead of creating a new entry. Allow only
unique keys to be present in the table.