move navigator.mozTCPSocket check into try block