Store seq number in perform for error handlers

Store seq numbers in perform so error handlers insert the proper
handlers on retry.

Fixes issue #39