handle incomplete writes

we should not expect (large) iframes to be written in one go , thanks to pieterg