hw: move CPU state serialization to migration/cpu.h