Scottish farmers win battle over food subsidies