fix bug : quick direction change makes snake die.