High-resolution detection of neutral oxygen and non-LTE effects in the atmosphere of KELT-9b