Prevent NPE in DeleteTask on AS shutdown