PostgreSql stores: verify retrieved hashes

Check the hashes of retrieved segments and slices against the hashes
with which they were stored.
Fix segment slice adding and parsing bugs