test: use expectsError in test-debug-agent.js
Use common.expectsError() in place of inline validation function in test-debug-agent.js.
like #11409 #11408
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
test errors debugger