Fix HTTP/2 handling leaking device if stream is not found or inactive


Move unique_ptr taking ownership of QIODevice earlier in the HTTP/2
handling to prevent it from leaking if the stream is not found or is
inactive (closed or idle).

The write function for devices must always take owvnership the device
and destroy it when it is no longer needed.

Task-number: QTBUG-137330
Pick-to: 6.10 6.9 6.8
Change-Id: I5c7df2dfaca25c382717ec9afe6607f1919475d7
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
commitdda6bf71245cd075039a9a2714b1940db29a6781
parent1d2e0c43b40fc55daaf60931e5ba63c823265067
authorØystein Heskestad <oystein.heskestad@qt.io>
committerØystein Heskestad <oystein.heskestad@qt.io>
commit timeFri, 4 Jul 2025 12:55:19 +0200