Increasing timeout between maintenance mode and restarting hostd

Increasing the timeout to wait for esxi to exit maintenance mode to prevent the Mem race conditions.
Can we check the maintenance mode status to see whether we need to sleep longer rather than just increasing the timeout?