Add __destruct to SessionManager

## Overview
Adds a __destruct method into the SessionManager to ensure that writeClose is called prior to PHP destroying the object references from a session becoming closed.  When the destructor is called it will then call writeClose; in the event that writeClose was already called the storage would then be marked as Immutable.  Therefore writeClose now additionally checks to ensure that if the storage is immutable it will not execute the closing again.

This issue happens primarily when utilizing a database storage handler or something that rewrite other resources.

## Issues Resolved
#2628
#3075
#3108
#3182