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

Current behavior is C++ assertion failure. Closes #8187
I think `hostname !== null` should be `hostname != null` (non-strict) so that passing undefined or false keeps working.