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