Fix directory content counting before file operation.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>