Managed to solve this in the end. For some reason there is already a constraint named qa_posts_ibfk_4 so I removed that using:
ALTER TABLE `qa_posts` DROP FOREIGN KEY `qa_posts_ibfk_4`;
And the upgrade worked.
EDIT: after checking information_schema.TABLE_CONSTRAINTS it looks like my qa_posts table has several different names to a fresh install of 1.5:
mine: PRIMARY, qa_posts_ibfk_4, qa_posts_ibfk_5, qa_posts_ibfk_6
default: PRIMARY, qa_posts_ibfk_1, qa_posts_ibfk_2, qa_posts_ibfk_3, qa_posts_ibfk_4
Gideon, do you have a SQL query that will reset all the constraints?