dns: resolve: verify argument is function

Don't use argument as callback if it's not a valid callback function. Throw a valid exception instead explaining the issue. Adds to #7070 ("DNS — Throw meaningful error(s)").