Cache declared entities using a unique key instead of hash.

Also build the key for Queues using bindings so that bindings
are properly declared.

This is a fix for celery/kombu#396