fixed crash if the user quits directly after performing a command & moved mysql_free...