MDL-33416 Get rid of DB field files_reference.lifetime

It is absolutely unnecessary because there is an API function for it and all repositories return contant there anyway
MDL-33416
MDL-41774 Fixed recursion in file syncronisation