px4io: fixed the io_reg_{set,get} errors

this fixes the PX4IO state machine to avoid the io errors we were
seeing. There are still some open questions with this code, but it now
seems to give zero errors, which is an improvement!
px4io: FMU half of px4io error fixes
lsm303d: try to reset the lsm303d if it goes bad in flight

this is based on earlier work by Julian Oes