Test executes various session commands in a loop and makes sure a COM_CHANGE_USER resets the history.