Is there some way I can update the viewer node during background rendering to output the correct results?
It doesn't look like it's possible at this point, at least not directly through Python:

https://developer.blender.org/T54314