[SPARK-3546] InputStream of ManagedBuffer is not closed and causes running out of file descriptor

this part looks good to me