Make testing of BoostVM::portClosed() thread-safe

* So the optimization in sendToVMPort() is safe to perform.