John McGinn came off the bench to end Scotland’s 10-game run without a competitive victory by firing an 86th-minute winner against 10-man Croatia.