The static connection counter caused a race condition. Moving the
connection id counter into conncache solves it, as well as simplifying
the related logic.