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

Fix for issue #2145
`sequelize 1.7`
You could store the original table before modification. (I believe i use the original tableName other places in the code).