discussions: fix pinned discussion sorting

fixes CNVS-10801

The issue here is that discussion topics have a null position
when they're first pinned. Our sorting library doesn't handle
null positions, so we need to initialize it when we pin topics
and fix legacy data on demand.

To test legacy data handling, you can run the "BEFORE PATCH"
instructions or run this in the console:

DiscussionTopic.update_all(position: nil)

test plan:
  *** BEFORE PATCH ***
  * create a course with many discussions
  * pin some of the discussions
  *** after patch ***
  * pin, unpin, and sort discussions
  * refresh the page
  * verify that your discussion positions persist

Change-Id: I6770c584b4af41ddf9592d39fa14b5a424c5c57d
Reviewed-on: https://gerrit.instructure.com/31589
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>