Implement equality comparison for database objects.

If they are from different stores, storm consider them different, but this
causes some errors on Stoq.

Fixes bug 5356
Release Stoq 1.5.1