After a few years of running well, the backup of 60GB database suddenly slowed down during one month from 2.5 hours to 24 hours.
It was slow only for that Linux based NAS, the speed for Windows shared directories was about 2.5 hours.
After below described change I achieved the speed allowing the same backup to be done within 40 minutes.
In the function void nbackup::create_backup() in the function call CreateFile I changed the flag GENERIC_WRITE to GENERIC_READ | GENERIC_WRITE.
The reason for the change is described in MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx):
When an application creates a file across a network, it is better to use GENERIC_READ | GENERIC_WRITE for dwDesiredAccess than to use GENERIC_WRITE alone. The resulting code is faster, because the redirector can use the cache manager and send fewer SMBs with more data. This combination also avoids an issue where writing to a file across a network can occasionally return ERROR_ACCESS_DENIED.