Use hash table mutex correctly

In the hash table `put` function, we always created and destroyed a new
mutex, which actually is wrong in a quite obvious way.

Now, the mutex is created in the `load` function an destroyed in the
`unload` function.
Use consistent syntax for checking return values