Fixed floodfill freeze issue.

I fixed an issue a few people reported where clicking multiple times while floodfilling caused the browser to hang. I don't know why the diff shows so much change, I just added around ten lines.