move the debug flag into the shm.

This allows us to gdb to the mainpid for eg, and enable the flag
when for whatever reason we can't gdb to a child process.

.. or when we just want it enabled globally rather than just within
one process.