Replace a common allocating loop for obtaining an op_depth ancestor with a
generic helper function that does this smarter and without unnecessary
temporary allocations.

* subversion/include/svn_dirent_uri.h
  (svn_relpath_limit): New function.

* subversion/libsvn_subr/dirent_uri.c
  (svn_relpath_limit): New function.

* subversion/libsvn_wc/wc_db.c
  (read_children_info,
   read_single_info,
   scan_addition_txn,
   svn_wc__db_op_depth_moved_to): Replace loop until op-depth reached
     constructions with a call to svn_relpath_limit.


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1545123 13f79535-47bb-0310-9956-ffa450edef68