Cody McDonald scored in the final minute of stoppage time for Gillingham as his side claimed a 1-0 win over Wolves in Sky Bet League One.