run mysql_install_db if datadir is set annd mysql database is missing

If the datadir is changed in the my.cnf, then mysql_install_db must be run to create the basic mysql database etc. in the new datadir. This change checks if datadir is set and if the directory mysql is missing in the datadir, if so mysql_install_db is run.