AFAIK- You don't need to do anything.. failed synchronous messages should automatically get deleted once the retention period has expired as their status is set to final.
What is the retention period you configured for sync messages?
You can still check ITFACTION the status in the table SXMBPMAST which should be "DEL".