This could happen if you switched the qa_users table to MyISAM, rather than leaving it as InnoDB. This creates a problem for foreign keys that reference the table.
Two solutions:
1. Convert qa_users back to InnoDB
2. Remove the foreign key in the definition by changing this in qa-db-install.php:
'CONSTRAINT ^userfavorites_ibfk_1 FOREIGN KEY (userid) REFERENCES ^users(userid) ON DELETE CASCADE'
... to ...
null
You will have to do similar things with subsequent problematic upgrade steps if you choose this route.
Another solution might be to replace InnoDB with MyISAM in the source code of qa-db-install.php, if you want all tables to by MyISAM.