webrtcendpoint: Do not deadlock if element is released from its own thread

Change-Id: Iad2c4b8b30dcd25167a0aadc79f04a483a3fe2ff