path: add depth argument to dirname (recursion); update path api doc

path.dirname('/foo/bar/baz/asdf/quux')
// returns
'/foo/bar/baz/asdf'

path.dirname('/foo/bar/baz/asdf/quux', 2)
// returns
'/foo/bar/baz'