Backup and Migrate writing empty files locally
Found out the problem: a file system quota on that particular user on the server. Drush finally gave me this clue when I ran it as the web user:

drush bam-backup files
dm-0: write failed, user block limit reached.
file_put_contents(): Only 0 of 400 bytes written, possibly out of free disk space files.inc:411                         [warning]
Public Files Directory backed up successfully to XYZ-2016-12-27T23-28-18 ( bytes) in destination      [success]
Manual Backups Directory in 12 min 59 sec.
Error while sending QUERY packet. PID=19337 database.inc:2227

Of course there was plenty of disk space, just not available to that user, and I never saw that message when running the command as root. There was enough space available to write the database backups, just not the files directory backup (600MB). Of course, BAM sent me emails saying the backup was successful. I still don't know what the error sending the QUERY packet is about, but the earlier problem of mysql crashing noted did not reappear. Also, I discovered that the web user was not the owner of the module - I forgot to change the ownership after having drush 'update all' earlier (as root); that could have caused the other problems, but the main issue was the disk quota.

In any case, drush bam-backup archive finally worked. Hope this helps someone else in the future.