Wasteful Celtic survived a late scare against 10-player Aberdeen to deliver Wilfried Nancy's first win after five attempts.