dns: throw if lookup() hostname is not string or null

Current behavior is C++ assertion failure. Closes #8187
If the error message being thrown is:

> invalid arguments: hostname must be a string or null

Then I think the check should only allow for string or null.

@bnoordhuis what do you mean by "passing undefined or false keeps working"?