[loc] hash functions improvements

* Fix a leak when freeing the hash table (actual size is htab_size+1)
* Use a better hash algorithm
* Use a larger table with a size already set to a prime