Preserve user supplied JOIN order

JOIN clauses order is important, previous implementation has always put string or arel joins at the end (after auto-generated association joins).

Fixes #12953, #15488, #16635.

/cc @tenderlove
Having a hard time following these assignments. Can be nil, a hash, or a string… tough to trace its behavior among its collaborating methods.