quic: don't record fin bit as sent when it wasn't

When appendStreamFrame is provided with the last chunk of data
for a stream, doesn't have enough space in the packet to include
all the data, don't incorrectly record the packet as including
a FIN bit. We were correctly sending a STREAM frame with no FIN
bit--it's just the sent packet accounting that was off.

No test, because I can't figure out a scenario where this
actually has an observable effect, since we're always going
to send the FIN when the remaining stream data is sent.

Change-Id: I0ee81273165fcf10a52da76b33d2bf1b9c4f3523
Reviewed-on: https://go-review.googlesource.com/c/net/+/564796
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
diff --git a/internal/quic/packet_writer.go b/internal/quic/packet_writer.go
index 85149f6..9ed3935 100644
--- a/internal/quic/packet_writer.go
+++ b/internal/quic/packet_writer.go
@@ -388,11 +388,7 @@
 	w.b = appendVarint(w.b, uint64(size))
 	start := len(w.b)
 	w.b = w.b[:start+size]
-	if fin {
-		w.sent.appendAckElicitingFrame(frameTypeStreamBase | streamFinBit)
-	} else {
-		w.sent.appendAckElicitingFrame(frameTypeStreamBase)
-	}
+	w.sent.appendAckElicitingFrame(typ & (frameTypeStreamBase | streamFinBit))
 	w.sent.appendInt(uint64(id))
 	w.sent.appendOffAndSize(off, size)
 	return w.b[start:][:size], true