dns: resolve: verify argument is valid 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)").
Adds test for #7071. (ced98f1870d17a2766d671d25eb613f708255e1c)