optimize Course#associated_accounts query
optimize Course#associated_accounts query

only return each account once, since it'll explode for courses with
many many sections

Change-Id: If61abf69c1c4d3b72fac184c767693fa2c64b76d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246513
Reviewed-by: James Williams <3a5f4ed991dbfa5c9ef76ad729d240ca12f62180@instructure.com>
Reviewed-by: Simon Williams <088e16a1019277b15d58faf0541e11910eb756f6@instructure.com>
Tested-by: Service Cloud Jenkins <9144042a601061f88f1e1d7a1753ea3e2972119d@instructure.com>
QA-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>
Product-Review: Cody Cutrer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@instructure.com>

sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms,sfu/canvas-lms