Re-ordered servlet events to avoid memory leak during re-deploy