Ireland have kept their slim Six Nations title hopes alive with a tight 27-17 bonus-point victory over bottom-placed Wales.