Move CriticalSection into rtc_base_approved.

This class is being used from both libjingle and webrtc but we recently had a regression when we added dependency on libjingle's Thread class. This cleans that up and moves the implementation of CriticalSection and helper classes into the source file.

I'm also improving debugging facilities and constness.

BUG=
R=magjed@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51769004

Cr-Commit-Position: refs/heads/master@{#9089}
5 files changed