Use mysqli_real_connect to add support for client_flags. Fixes #27.

This also includes the core way to detect socket connection.