Patch from Noel Belcourt, with some minor changes for portability. Implements action output deferral to sync the output regardless of -jn.