fix fcntl F_SETFL check return value