Update backend_webagg.py

Change WebAgg backend to handle stale figure UI controls in the browser
Update mpl.js

We are generating 'ReferenceError: figure is not defined' when we try to download a figure into a particular image type.
Merge pull request #2648 from JamesMakela/master

Update backend_webagg.py