Adam Smith's first goal for the club gave Millwall a much-needed 2-1 victory against struggling Bristol City.