Use less memory when putting docs on couch. Closes #5011.