Fix sessions not closing on request ending