Add signal mask save/restore to the checkpoint code. Reorder the file