When closing the game, we flush the command queue but after we are pushing the freeing calls of the id pool to the command queue and they are never being run. Now we free them directly. (cherry picked from commit 7aa4622222)
7aa4622222