fixed NPE

Some entities corresponding to 'key' might not exist in datastore nor memcache because most queries return result with evantual consistency.
if in that situation, NPE raised in entity.getEntity().