CAP-426: Lock the asynportdriver before deleting it
If the asynportdriver is deleted without locking it first, we might run into problems if the portdriver is communicating. I can reliably cause segfaults without this locking in place.
Dear @hinkokocevar, could you please merge this?
Thanks!