resolved: avoid possible dereference of null pointer

In dns_scope_make_reply_packet the structs q, answer, and soa can be
null. We should check for null before reading their fields.