Ensure RPC are not delivered to closed UIs (#11714)

Change-Id: I7fadaa5d5190c36cd83a06249d7ae1d4475724e0