ensure write_streamed_attachment bails on negative LenLeft values While Filipe has identified the fix for COUCHDB-1021, this patch will ensure that no other bug will cause negative values to be passed to this function, in turn leading to database inflation problems, etc.