Gareth, I believe that this is caused by multiple session listening on completed tasks events and when second task is completed (from another process that was started by new session) events are sent to all listeners - meaning two sessions and both will try to resume process and thus optimistic locking exception. You can instruct the work item handler to only react on tasks completed events that were created by given session by setting workitemhandler.setOwningSessionOnly(true) that should ensure only session that created the task will consume its completed task event. Please not that this forces you to use same session (with same id) to resume process after task was completed.
HTH