Added code for tracking whether or not we're running in response to an interrupt. Currently, this includes userapi handlers.