Merge "Closing the stream when the function returns" into main am: 14b322b251

Original change: https://android-review.googlesource.com/c/platform/bionic/+/2856549

Change-Id: I122aa422252ee68099d46440e793dc54f8ca7f63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>