Fix race in checkDetachAfterOpen
Fix race in checkDetachAfterOpen

checkDetachAfterOpen incorrectly accesses detachCalled
without holding the lock

Relates to #838

pion/webrtc,pion/webrtc,pion/webrtc,pion/webrtc