Protect id generator with GUARDED_BY

The class IdGenerator is not thread safe, so we should protect the
object of this class with the lock.

This also allows us to dump the dispatcher state if the fatal log is
triggered.

Bug: 281806933
Test: none
Change-Id: I206dccc4f4991a76419b04bba3b35ac2264987df
2 files changed