list-needed: Unset optdepends and depends each time around the loop.

This speeds things up a bit.