fix #1372 Storage event issue

This commit makes sure storage events do not cause errors when the stored
values are not JSON, or when events are not listened to.