HUE-2383 [filebrowser] Close file handle in read_contents properly