dgram: fix abort on bad args
This commit fixes a C++ abort for connected dgram sockets by improving input validation in the JS layer.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines