linuxkpi: Rework detach function
We need to detach the matching i2c adapter so look for the right one.
While here add some locks to protect multiple add/del at the same time.
Fixes: 1961a14a47 ("linuxkpi: Add i2c support")
Sponsored by: Beckhoff Automation GmbH & Co. KG
(cherry picked from commit 25d21a845223ffad189fd2a7831ebf5e298b628a)