core: Document core::path::GenericPath's trait methods
core: Use a better termination condition in os::mkdir_recursive

Instead of checking whether the parent is "." or "/", check the
number of components.

Also, more tests.
auto merge of #6107 : catamorphism/rust/mkdir_recursive, r=brson

r? @brson This hopefully addresses your concerns about the termination condition, and adds more tests. With a bonus documentation commit.