Add os::CleanupFunction to clear the GlobalService

The GlobalService is not cleaned up at the end of the process. There might be services added to the GlobalService that need proper deconstruction.