The solution is to make pedestrians afraid of stepping into the bike lane. Pass them quickly, closely and surprisingly, if they run into something in the process all the better.
Not to mention that, in my jurisdiction, if this sort of behaviour led to injury or damage to property, the cyclist would almost certainly be found to be at fault, at least partially.