fix: prevent data race with cursedRenderer.onMouse (#1691)