Check if peerConnection was set previously to close it

Change-Id: I1649582d12c7a6be5dc12f8f501ef78a32d68b95