Check errno for error from ptrace.

PEEKDATA may return a word that *is* -1.

Other minor type changes/reorganization included gratis.