Deinit called on global object?

As was shown, deinit is called when you use @main-entrypoints. What you've demonstrated is one of the known bugs with top-level code when @main is not used.