All Rust commits from Facepunch
Refactor some methods to remove the need for resetPathOnFailure and prevent potential inconsistent behaviour in debug mode