Move access rights and closing to SConnection object

This makes it generally useful and other code doesn't have to
know of the specific sub-class.
7 files changed