St Johnstone secured a first league victory in three games, courtesy of a 2-0 win over Kilmarnock at McDiarmid Park.