Update record on DB Session write

If you have a shutdown handler which wants to write to the session then you get problems with duplicate `session_id`s when using the DB session driver because the record was not being set and it was trying to create a duplicate session record in the DB