Updates to prevent duplicate Salesforce batches.

This commit includes some outstanding updates to prevent duplicate batches being sent
to Salesforce during queue processing.