It looks like trains from Krakow to Katowice are quite frequent - at least once an hour.
If you are nervous about the five minute connection why not take an earlier train for the first leg of your journey?
That's probably what I would do... but I'm very much the cautious type!