Niall McGinn's 20th goal of the season was enough to secure a 1-0 victory for Aberdeen over Kilmarnock at Pittodrie.