Fix line-jumping bug in FIFO implementation

Keep the FIFO's internal set in sync with the queue during Add/Update
operations to prevent a queue line-jumping scenario (described in a
new unit test).
@lavalamp Done, thanks.