Cache local widget settings so they don't get overwritten on save

Fixes #1908