Improve error handling in HttpFileElement


* get rid of unnecessary variables
* use QIODevice::Truncate instead of removing a file and
  then re-creating it
* do not try to write() into a file if open() failed
* check the result of write()
* update the debug messages

Change-Id: I46a4552e157b2b43abefa6f81e09856564eabd80
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
commitcd6e89fab2c7b037a84aad3504dfdf1a61d0f12c
parentdbd01b3abf92f2d860d016a20e5030edb2981abd
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeWed, 10 Sep 2025 11:53:00 +0200