fixes sessions leaking withSession in some cases

I found a leaking session bug while writing docs sample code. This fixes it. Please check that changing the lazy val into a val does not have unwanted consequences.

review by @szeiger