Fix expending buffer in StdCopy

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Add regression test

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Merge pull request #4925 from creack/fix_logs

Fix expending buffer in StdCopy