@kas1e
Have you tried disabling the three lines before alutExit?
alcMakeContextCurrent(nullptr);
if (context) alcDestroyContext(context);
if (device) alcCloseDevice(device);
These should be unnecessary and may cause problems as alutExit() does more or less the same when called later in the program.