Ireland secured the win they needed against Italy to keep their faint Six Nations title hopes alive, with Dan Sheehan scoring a hat-trick.