setup: fix crashes due to an unbalanced lock

When connecting and disconnecting machines buzztrax crashes with this
error:

  Attempt to unlock mutex that was not locked

Since async_add_to_pipeline() and async_remove_from_pipeline() unlock
a mutex, be sure that the mutex is _always_ locked before calling these
functions.

Fixes #16.