TWI timeout

Adds an iteration limit to the while loops in various ```twi_``` functions and resets TWI bus if limit is reached.
Stops entire microcontroller form hanging if for whatever reason the TWI bus fails.