Fixed bug regarding insertion in SortedMap.

Fixes idris-lang/Idris-dev#1394. Solution based on the diagnosis in @sebzim4500s comment.