Add utility method for getting the path to the top-level directory

To fix wp-cli/server-command#3, we'd need the equivalent of `git rev-parse --show-toplevel` from WP-CLI.

Maybe something like `WP_CLI::get_root_dir()`.