Revert "Remove shared memory keys only if no segments are attached."

The patch lead to IPC memory leaks.

This reverts commit f9f047535efdca1f2cd28b15222f180635ca4125.
Update to 24.0.1312.68