Fixes #44 shell output was truncated sometimes

see this for details: https://github.com/MidnightCommander/mc/issues/44#issuecomment-60467020