Waiting times for heart appointments in Scotland are at their highest level on record, figures have shown.