Make size variables in dyn_buf_write unsigned so gcc will not optimize the