dirstate: fix rebuild; add a test
If rebuild calls invalidate, it will just queue a (re)read of the dirstate
file, while what we really want is to empty the current state.
# should print nothing# should print ? b/x? b/x# should print A b/xA b/x# should forget b/xforgetting b/x# should print nothing