host-resolve: only declare resolve_lock if needed

This patch avoids the declaration of resolv_lock if not needed.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>