write past end to improve speed

It turns out that writing to the buffer before increasing its size saves a save/restore of `c` on the stack, since `resize()` destroys registers.

Also fixes a memory corruption bug in outdeps.d this uncovered.