fixed mutex usage in getTotalUpstream and getTotalDownstream and added initialization to connectionStartTime (cherry picked from commit 15161eec)