WICKET-4965: Fix NPE when stopping the container