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.4' into PHP-5.5

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