Fix overhead accounting bug for critical sections