kernel: forbid ptrace on system processes
The scenario that triggered this change is the GDB test suite which
tries to attach to process 0 (the swapper). This dereferenced a NULL
pointer while reparenting the swapper to GDB as the former has no
parent.
ptrace(2) is intended for debugging user processes so prevent it
altogether on system processes as this is deadlock prone.
There were already calls to procfs for preventing accesses to registers
of system processes. Remove the now superfluous comments but leave
these calls as they may be extended someday to check for more
conditions.
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2615>