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