widgets: refactor to run data callback in main thread