s390/traps: convert pgm_check.S to C