fixed pause on non-empty bufferAmount in webrtc and closing of transport in the next event loop, after sending the last message