cancel keepalive on retry per extend/gun#16

@essen does this look good? I was on the fence about pulling the flushing out into flush_keepalive function, and left it inline at the end.