leave transaction control to xivo-stat

helps in rollbacking transactions during errors
fix pep8 warnings
Merge branch '5084_rollback_on_fail'