Call the write function's callback when finished writing.