Fix CodeMirror RangeError and map forward-reference in notebook
editor.ml: Clamp widget decoration positions to doc_len-1 to avoid
CodeMirror RangeError when mapping decorations through changesets.
Also catch exceptions in refresh_messages to prevent cascade failures
in cell execution. The root cause is a discrepancy between the cached
document length and CodeMirror's actual document — needs further
investigation.
interactive_map.mld: Fix forward reference to `map` in on_click
callback. Use a ref cell (map_ref) to break the self-referential
binding, since `let map = Leaflet_map.create ~on_click:(... map ...)`
is an unbound-value error in OCaml.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>