Improve mysql_grant to work with IPv6.

This work attempts to improve the situation for matching IPv6
IP addresses, as the previous regex couldn't handle them properly.
Merge pull request #308 from apenney/fix-grants

Improve mysql_grant to work with IPv6.