shmem: Fix broken handle allocation causing assertions and crashes.
shmem: Fix broken handle allocation causing assertions and crashes.

The free handle index was incorrectly wrapped which could lead to allocating handles beyond the handle array under specific circumstances leading to assertions and possible data loss due to overwrite.

Detected when testing Chromium.

bitwiseworks/libcx,bitwiseworks/libcx