[1.6.x] Corrected scoping of savepoint example

Backport of 27f68f8659a648cc9ed3e71f690959ed8a130c5a from master