test: use a more direct approach to test racy mutation
The previous test was relying on implementation details and harder to maintain.
The new version is closer to the initial intend : "What happens the file get overwritten from under the current process"
This change is motivated by further changes around the transaction and dirstate
logic that would break the fragile equilibrium that existed before this patch.
Making this change early make it easier to review on its own and remove noise
in future larger changes.
edition = "2018"
max_width = 79
wrap_comments = true
error_on_line_overflow = true