Added Security::generateRandomHexKey(), used it for various tokens and default key generation

Fixes #4114.

Needs review.
https://github.com/yiisoft/yii2/commit/efe5727ff7f694ef724082cd1d29f3241b04468c