Wrap captured panics in a struct that includes a stacktrace