*8151* Added session_write_close as a shutdown function

Suggested workaround for the APC "Class '...' not found" issue.