canvas: Properly restore all the remaining items in stateStack in endDrawing.
canvas: Properly restore all the remaining items in stateStack in endDrawing.

We were correctly finishing the SMask group but not restoring all the extra
transformations applied in stateStack, so if somebody ends up drawing to the
same context after canceling mid-draw we'd get artifacts.

This fixes Mozilla bug 1664178[1].

[1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1664178

macroplant/pdf.js,macroplant/pdf.js,nawawi/pdf.js,caremerge/pdf.js,Shoobx/pdf.js,mozilla/pdf.js,showpad/mozilla-pdf.js,xavier114fch/pdf.js,Snuffleupagus/pdf.js,mozilla/pdf.js,Shoobx/pdf.js,timvandermeij/pdf.js,macroplant/pdf.js,showpad/mozilla-pdf.js,nawawi/pdf.js,caremerge/pdf.js,nawawi/pdf.js,timvandermeij/pdf.js,mozilla/pdf.js,timvandermeij/pdf.js,xavier114fch/pdf.js,showpad/mozilla-pdf.js,Snuffleupagus/pdf.js,Shoobx/pdf.js,Snuffleupagus/pdf.js