MULE-7080: Race condition checking file attributes on SFTP transport

_ Refactoring code to make it a bit more readeable
_ Adding some extension points to improve testability
_Replacing logging in INFO with logging in DEBUG level
(cherry picked from commit 28fa18c)