srv_lookup: Portability fixes, handle compressed responses

srv_lookup works on cygwin and openbsd now.

Provide ns_initparse, friends, and types where they aren't provided by
platform.

Use dn_expandname instead of custom parser so compressed DNS responses
are handled correctly.
Allow filtering of blist output

Add an (optional) second parameter to blist. If present, it is treated
as regex and used to filter the result list.