Fix failed agent checks after restarts.

Refs #4865