m7-common: tfa9887: Fix race in checking whether or not to reconfigure

Multiple threads can request that we set_mode.  When
we check to see if we need to reconfigure the amp, make sure
that we are locked to avoid race conditions.

Change-Id: Ic247fdd8d1c55cd054053b9b7dc38d99a16cb33f