Make BatchInvitation.perform more robust

This seems like an obvious improvement to make, and might help debug problems
on preview right now.