Pass the extension instance to SignalHook-registered signal callbacks.

When using SignalHook, the callback will now be passed an extension
instance as a keyword argument, making it easier to operate on the
extension or access settings without having to fetch the instance.

Due to the changes being made here, I've also changed sandbox behavior
so that we always log the error, even if we're not sandboxing.

Reviewed at https://reviews.reviewboard.org/r/6602/