yaml: use selected user and not admin for onchange

Fixes: #1885
yaml: use selected user and not admin for defaults
[FIX] sql_db: close db connexions before removing them.

Closes #831 aka lp 1322191
[FIX] event onchange event type

Courtesy of Alejandro Santana

Closes: #1046, #1047
Merge pull request #1886 from lepistone/7.0-fix-yaml-onchange-user

use selected user and not admin to run yaml tests