BUG/MEDIUM: fd: Always reset the polled_mask bits in fd_dodelete().

In fd_dodelete(), always reset the polled_mask bits, instead on only doing
it if we're closing the file descriptor. We call the poller clo() method
anyway, and failing to do so means that if fd_remove() is used while the
fd is polled, the poller won't attempt to poll on a fd with the same value
as the old one.
This leads to fd being stuck in the SSL code while using the async engine.

This should be backported to 2.0, 1.9 and 1.8.

(cherry picked from commit c22580c2cce86473221f58cf11db19056a5f2f7c)
[wt: polled_mask[] is only an array in 2.0]
Signed-off-by: Willy Tarreau <w@1wt.eu>
diff --git a/src/fd.c b/src/fd.c
index e71c2ee..2af83f3 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -378,6 +378,7 @@
 	}
 	if (cur_poller.clo)
 		cur_poller.clo(fd);
+	polled_mask[fd] = 0;
 
 	fd_release_cache_entry(fd);
 	fdtab[fd].state = 0;
@@ -387,7 +388,6 @@
 	fdtab[fd].owner = NULL;
 	fdtab[fd].thread_mask = 0;
 	if (do_close) {
-		polled_mask[fd] = 0;
 		close(fd);
 		_HA_ATOMIC_SUB(&ha_used_fds, 1);
 	}