Detect the location of chvt and fgconsole instead of hardcoding it for different distros.