The Debian start script for MariaDB, in debian/additions/debian-start and debian/additions/debian-start.inc.sh, runs mysql_upgrade without specifying --skip-write-binlog. As a result, statements contained in scripts/mysql_system_tables_fix.sql will be replicated and fail on the slave.
To be more specific, the ALTER TABLE statements to general_log and slow_log will be replicated, and although mysql_system_tables_fix.sql does disable each of them before running the ALTER TABLEs, these SET statements will not be replicated. When the ALTER TABLE statements are replicated, if the slave system has either log enabled, then replication will break.
I believe debian/additions/debian-start should be modified so that
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf --skip-write-binlog"