Testsuite and mysql utility functions fixes

Not in specific order:
- Allow for MySQL password to be passed on testsuite environment
- Avoid leaking of MYSQL object if connection fails
- print more verbose error messages in case of MySQL failure