Foreground dust and gas and the extinction curve of the Large Magellanic Cloud