Tidy up and improve error recovery for C++11 attributes in bad places. Based on
a patch by Michael Han.