Only persist changes when no exceptions occurred.

Move session.save() call into try block, so no partial changes are
persisted if any exceptions occur during component operations.

Signed-off-by: Gregor Zurowski <gregor@zurowski.org>