Added timeout interrupt and fixed small issues

This allows the i2c module to return quickly even under erronous
conditions.