[PATCH backport for 5.4] tee: handle lookup of shm with reference count 0