Fixes FileCache.__contains__ and __iter__ when sync is on

Internal method _all_keys tried to to access _buffer which is only available
when sync is off.