Fix catch of unit test failures
- Unit test failures were not triggering a non-zero return to the calling shell. Now fixed.
- Moved the pre-deletion of the shared memory segment until after all processes have wrapped the buffer in a numpy array, ensuring that the buffer is not released too early. This fixes a failure on macos.