fixed 'shmget' error handling