Make p global in the sigterm handler

This causes errors like:

./bwauthority.py:71: SyntaxWarning: name 'p' is assigned to before global declaration
  global p

in some recent python versions.

It appears to be one of those lovely python hiesenbugs that appears and disappears depending on python version, OS, and other code changes.