identd: Rework lowestSocketId handling
Since we're appending only strictly increasing integers, the lowest
socketId is always at the front of the list (if that exists).
hasSocketsBelowId also had a off-by-one error. This had no effect on the
code since a socketId equal to the current _socketId cannot be in the
_waiting list.
Reorder processWaiting's handling of requests:
- If the socketId is one the request might have been waiting for,
check responseAvailable.
- Otherwise, if there is at least one socket we need to wait for,
continue waiting.
- Otherwise, responseUnavailable.
The former order was:
- If there are no sockets left from before this request was made,
responseUnavailable.
- If the socketId is one the request might have been waiting for,
check responseAvailable.
- Otherwise, continue waiting.
The change was necessary as the lowestSocketId no longer includes the
socketId that was just removed. In addition, the new order also matches
the if-else chain in IdentServer::respond.