doc: update examples in writing-tests.md
writing-tests.md
states to use arrow functions when appropriate. This updates the examples to do that.
Further, this syncs the docs with what's found in test/parallel/test-http-agent-null.js
Checklist
-
documentation is changed or added -
commit message follows commit guidelines