Guard against unregistering an unregistered callback
Thanks to David Edmundson for catching and fixing this.
Differential revision: D5539