Fix ORDER BY with INNER, OUTER JOIN and LIMIT, issue #2145

Fix for issue #2145
`sequelize 1.7`
It is quite hard to do reverse engineering, you have a better konwledge of sequelize than me, maybe you have a simple solution ? Perhaps using a piece of code from `function quote` ...