Resolve real absolute path if prog path is a symbolic link in `_get_path_of`

In current implement, `$mysql_basedir` resolving possibly fail if mysql_install_db
is a symbolic link.

In my case, I'm using MySQL 5.6.10 homebrew installed in OSX upgraded from
5.5.28 and `which mysql_install_db` returns '/usr/local/bin/mysql_install_db',
but this is a symlink to '../Cellar/mysql/5.6.10/bin/mysql_install_db',
and `$mysql_basedir` resolving will fail.

Then I wrote this patch, but I have not so confident if is this patch appropriate or not.