Refactor #9844 Slow connection mysql_connect() (Windows)

http://tracker.modx.com/issues/9844