This is a follow-up to blackmagic-debug/libopencm3#5.
The existing implementation would work for LSE-clocked LPUART at e.g. 9600 baud, but would overflow the calculation for lpuart_ker_ck above 2**24 Hz (16.7 MHz).
Use a smarter div-mod approach, like in set_baudrate, recommended by @zyp (asking review).
Please test correctness on hardware. Now it should work for e.g. 64MHz G071 (or G4, or H7). I don't have a unit test or a firmware test project, but I have some boards.