cpm2: Fix race condition in CPM2 GPIO library.