fast python implementation of dnsmasq callback

Serializes dnsmasq execution. Executed a few times per domain.
Significantly lower CPU utilization than original version.

Change-Id: I3e239519e7d4b457d6c9689ab6366f86415d12d7