librfm3: i2c_ctx: Split out the I2C driver to a library

Splitting out the code also helped identify a bug in i2c_ctx_getdata().

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>