Use Transaction in TrytonServer to set correct Flavor

issue3372
review1070002
Activate foreign_keys in SQLite if available

review1064002
Use array optimisation of python-sql 0.2

review1057003