Fix slow library update when sources are unavailable.

Similarly to the fixes for clean library, avoid stat() calls by testing
the source's existence and doing string comparisons during scan.