Fix for recursive calls ArrayHelper::toArray() with objects

Fix for https://github.com/yiisoft/yii2/issues/5893