Restructure code in directory_entry.obs/file_type_obs.pass.cpp and directory_entry.obs/hard_link_count.pass.cpp to reduce the amount of ifdeffery needed.
In file_type_obs.pass.cpp, we can't inline the calls to env.create_* into the lambda calls (e.g. "test_path(env.create_*())"), because the lambda removes the referenced file, and the hardlink must be created while the earlier test file exists.
In hard_link_count.pass.cpp, move restoration of the original directory permissions to the end of the lambda, so that new directory entries can be created after the lambda has run once.
As a general pattern, could we instead refactor the body of the loop (which contains the actual tests) into a lambda, and then call it with the appropriate inputs? I think that might make the #ifdefs less awkward. WDYT?
I don't think it makes sense to do that everywhere, but I think it might here.