The GRAVITY young stellar object survey: II. First spatially resolved observations of the CO bandhead emission in a high-mass YSO