server: fix error handling for shared memory handling