lib/model: Fix rescan detection (fixes #4505, fixes #4506)
lib/model: Fix rescan detection (fixes #4505, fixes #4506)

Diff is large due to comment reformatting and indentation but all it
does is wrap the file mtime/size/permissions check in an "if
stat.IsRegular()".

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4507

syncthing/syncthing,lkwg82/syncthing,syncthing/syncthing,imsodin/syncthing,xduugu/syncthing,rumpelsepp/syncthing,AudriusButkevicius/syncthing,xduugu/syncthing,syncthing/syncthing,jryans/syncthing,wweich/syncthing,jryans/syncthing,lkwg82/syncthing,rumpelsepp/syncthing,syncthing/syncthing,lkwg82/syncthing,uok/syncthing,wweich/syncthing,lkwg82/syncthing,xduugu/syncthing,AudriusButkevicius/syncthing,uok/syncthing,jryans/syncthing,syncthing/syncthing,jryans/syncthing,imsodin/syncthing,xduugu/syncthing,imsodin/syncthing,rumpelsepp/syncthing,AudriusButkevicius/syncthing,wweich/syncthing,imsodin/syncthing,wweich/syncthing,rumpelsepp/syncthing,AudriusButkevicius/syncthing,uok/syncthing,imsodin/syncthing,uok/syncthing,syncthing/syncthing