fix(session): Explicitly closing the session in the shutdown hook to work around APC session problems.

Fixes #7186.
Merge pull request #7497 from brettp/apc_session_close

fix(session): Explicitly closing the session in the shutdown hook to work around APC session problems.