Segment registers: backup/restore values

This ensures the test exits cleanly.