Steven MacLean scored 13 minutes from time as St Johnstone finally broke down 10-man Inverness Caley to claim a 1-0 victory.