Allow re-using already known fileinfo when calculating folder sizes

This saves us from having to get the info from the cache again.

Also included is some logic to prevent calculating the foldersize of the root of the homecache since this info isn't used anyway.

Combined this saves about ~5 queries for each write.

cc @karlitschek @DeepDiver1975 @PVince81