Fix bug with robot never breaking

When repeatedly calling drive(0, 0), we never braked, as break_distance got
reset each time.
lib: extract name from path also on Windows
lib: fix off by one
lib: limit name length

To prevent overflowing STD_BUF.