Add existence checks for Dnsmasq methods

This patch enables to handle the the neutron code
both with and without 9569b2fe58d0e836071992f545886ca985d5ace8.

Related to: MN-2757

Change-Id: Ibf939e3d185047a01392439ba22890664a5b335d