This reverts commit e60f26e0.
Cancelling the primary selection breaks text selection in applications such as gedit. In those apps, you can't select text neither with your mouse nor keyboard.
In either case, I think that it's worth reverting e60f26e0. An app crashing after disabling primary selection is not great, but it's one time only and it's less damaging than getting broken text selection on a reboot or app relaunch.