WFA: add numTransitions() function

(cherry picked from commit 3e6087a005754f1c664afd0ac0e8f5f8710ac53d)
WPDS:post/prestar: added assertion for empty query automaton

This assertion marks likely mistakes, code that I think wouldn't have worked anyway, and the tests pass. Don't feel like fixing it right (or really even if that's a good idea), so added a better error.

(cherry picked from commit 7d325bca4a92c6250a159aeefb34df9338251bb9)