There was a bug in older versions where the entry in the FILES table wouldn't get deleted. Your solution is probably the best workaround for the time being.

In version 8 we'll be introducing a bunch of new maintenance tools that will go through and clean up things like this (removing orphaned attachments, table entries, etc.)