Remove item from the active queue on connection error

Fixes  #2441