provision/docker: defer close calls on database sessions

Fix #428.