Session layer: fixed connection multiplexing threading bug