Micro-optimize perft

Avoid to call perft function when we just need to count
moves, at leaf nodes.

Speed up of almost 2%

No functional change.
Merge remote-tracking branch 'source/master'