Ensure a leading zero on the string.
Revert "I realized that the coercion to oct string I was doing was incorrect."

This reverts commit 8cd50a92ea913b05327b8291da3d2164993e726e.
Revert 'Coerced several values to string representations of octal where before they
were sometimes strings and sometimes ints.'
Revert 'int comparison rather than string comparison of octal values; zero padding on one but not the other caused spurious mismatch'
Use a string version of the mode.
Normalize stats()['mode'] for safety.
Expand tests for manage_mode
Restore MagicMock as it shouldn't cause any issues.
Merge pull request #10029 from kaithar/feature/fix-special-bit-perm-test

Better handling for special bit modes