correct logic for open of shared memory when existing size does not match expectations