Updated main.js to send offer/answer only after successful setLocal.