Fix parsing submissions with multiple payloads

This should fix the race condition when re-opening the long-polling
connection.