[server][Utils] Add a new method: removeGSourceIfNeeded().