Fix bug with stdout header detection on 2+ packets

Signed-off-by: Ben Agricola <bagricola@squiz.co.uk>