anidb: Retry writes if not cancelled.

Because UDP has unreliable delivery.