Reformkor, szabadságharc, kiegyezés