Update forms.py

Fix UnicodeDecodeError exception when sql params has unicode characters
Fix #571 -- Improve database engine detection.
Merge pull request #551 from GomZik/master

Fix UnicodeDecodeError in SQL panel.