make alloc_shared exit if we fail an allocation.
make all the shm array allocations shared.

I should have just done this from the start.