Fix savestates bug.

Sometimes or for some games, savestates didn't work. It was because saving was
done during emulator loop. It is now done during speed synchronisation as it was
in Palerider's version.