Fixes #29654: take reference to RWLayer while committing/exporting Upstream-commit: a157dc53a850dff19ead074f24f9eff61b9d0622 Component: engine