refs #153 protect connection appropriately also on get_stats, other backend close related fixes
Merge branch 'gh153' into 3.x