The workaround in my other message discards the return value of `with-dynamic-state'. I've improved it:
(let ((w-d-s with-dynamic-state))
(set! with-dynamic-state
(lambda (s p)
(let* ((e #f)
(r (w-d-s s (lambda ()
(catch #t p
(lambda x
(set! e x)))))))
(if e
(apply throw e)
r)))))
