Optimize directory diff routine. Part 3/3. Empty before_list on processing

Release memory allocated for before_list items while diff traversing not
after. This allow us to skip creation of another one temporary dep_list.
While here handle dl_shallow_copy failures