Make sure stream is closed when reading TGA header