Add error checking to nvm_tree_contains_path