SFTP: fix an issue with the stat cache

Fixes #402