Use a R/W lock to protect VI connection to allow concurrent r/w to VI.

Fixed #79.