Fix a bug where previously nil-cached attribute caches weren't expired on record creation

Attribute caches can cache nil. If we do some find_name_by_id style
attribute cache lookup, and it isn't found in the cache, we go to the
database, and if the database returns nothing, we store nil in the cache
to allow for cache hits next time.

If a record materializes that has the ID we were originally looking for,
that cached nil is now invalid and should be deleted. For record
creation, we had a bug in the attribute cache expiry logic that should
have deleted that key, and before this change we didn't DEL that key.
There was also a mistake in the test which tested that the attribute
key gets deleted.

Similary to secondary indexes, we need to delete both the key for the
old value of the attribute, and the new value of the attribute. So this
change is made to the expire_attribute_indexes method, and the test is
updated to expect the key to be deleted. The expire attribute_indexes
method is also optimized to only issue the delete for the same key once.