Properly detach and destroy shared memory after use.