Avoid holding the open_close_lock while performing activities

Instead of holding the lock while doing further activities just
release it and mark a variable that will determine if further
work is done.

This does leave the client open to simulatanous start/stop issues
from multiple threads but this seems acceptable as only one thread
should be using a client at a time anyway...