Second-bottom Kilmarnock edge a point closer to St Mirren - and safety - in the Scottish Premiership, but only after surviving a stoppage-time Dundee penalty award.