Protect m_ownedObjects by a mutex as unregisterObject() may be called from a foreign thread.

The GC calls finalizaters in whatever thread the collection happened, which can cause unregisterObject() to be executed in a different thread than where the driver and the object live(d). See also #419.