Fix endGeneratingDeviceOrientationNotifications being called twice.