In DesktopCapture, the callback OnCaptureResult also returns a result of
CaptureFrame, whether it was successful or failed. When ERROR_PERMANENT
is returned, it means that all the following attempts to capture a frame
will not succeed and at this point we should stop capturing. To stop
capturing, we propagate CaptureEnded event up to the DeviceListener and
stop screencast.
Differential Revision: https://phabricator.services.mozilla.com/D201956