Fix problem with expired token during clouds reset

Fixes bug #PH-163. The logic of the check of clients moved to clouds
extension.