Use $root_home for .my.cnf

Added also tests.