Add missing delete in InputStream close function.