Consider adding this *inside* the action contained in `Lwt.finalize` (i.e. on line 47).

Rationale: what if `Lwt_main.run` returns after the key & action are added to the map, but before the next line is reached? They should only be in the map if the action has actually been launched.