Don't rely on garbage collection to close and remove the tempfiles.
Before v3.1 there existed a draft wni storage. You can find it in the git history
(it was in /core/storage directory, now gone)