Check for absurdly large values of shmall and shmmax

Check for absurdly large values of shmall and shmmax before comparing them to prevent the shell from throwing error.