Add unit test and fix for crash during eviction of cache keys during query for compound identification attributes. closes #1171