update: simplify curl write handler

This gets rid of the silly zero termination in the buffer (wat, we know
the exact length), and also fixes a bug that would cause the capacity
of the buffer to be wrongly changed when the Content-Length is available.