A late Luis Palma goal means Celtic finish the season with a win as they see off a spirited St Mirren.