Define the ffs() function in the USB bootloader's global and
independent header file.
Optimise bit searching loop by using the ffs() function.
Make some related bit shifts unsigned while at it.