io: handling some edge sync cases in keepalive writer