Yes, referential integrity should've caught it, if not, would you please tell me, Roberto?
As to why it slipped in, bulletin boards used to be referenced by the topic itself, i.e. the name of the forum. Integer keys are considerably more efficient, so in 3.2 topic_id was introduced. It looks to me that someone spaced when porting the datamodel, changing "topic" to "topic_id" and simply forgetting to change the type.
The new bboard module for 4.0 will also use integer keys for the messages. If you look at site_wide_category_map, you'll see that the general categorization stuff uses a varchar key, simply to accomodate bboard's non-integer key. All that will speed up when this can be changed to integer, too.