Derive PartialOrd/Ord/Hash for bitflags structs. Implement Default for io::FilePermission

cc #15294

[breaking-change]