Early kinetic decoupling of dark matter: When the standard way of calculating the thermal relic density fails