Fix potential segfault in dns_get_record()

If the remote sends us a packet with a malformed TXT record,
we could end up trying to over-consume the packet and wander
off into overruns.
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fix potential segfault in dns_get_record()
Merge branch 'PHP-5.6'

* PHP-5.6:
  Fix potential segfault in dns_get_record()