libcore: change removal of tasks in Timer#purge

We believe there's a problem in PriorityQueue#removeAll, there will be
a follow-up change to fix that and back this code to use removeAll again

Also, address nits in https://android-review.googlesource.com/#/c/175538/

Change-Id: If11d578b101520bd8ce4641c8654313500ecac4b
1 file changed