Ticket #3577: Fix preallocation if appending during file copy