Fix parent path calculation when files are renamed (Bug #1359531)

Change-Id: Ibc3df16e0cfbf64f8ff77379352ae5cf2d3a172a
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>