Choosing the finesse direction

A J 3
A Q 7 5 3 2
10 4
5 4
N
W E
S
K 10 9 2
K J 9 8 6
Q
K J 6
Vuln E/W
Dealer South
West North East South
1
Double 4 All Pass
4
by S
Lead: A

West wins the opening lead and continues with a trump. East follows and you win with the king. You have nine immediate tricks including a diamond ruff in hand, and you can easily set up a spade trick even if the finesse fails.

But did you count your losers? The worry is that you might lose a diamond, a spade and two clubs. How do you avoid that danger?