Fix ra_stop() to use is_mysqld_running() function for each loop