Update texture using double PBO

The proccess is just like VBO, at a time, one PBO is mapped for
update data in another thread in CPU side, one for updating texture
in GPU side.

Signed-off-by: plysan <plysab@gmail.com>
Make double vertex data store in client memory

When the update thread copy data to client memory, Node traversal
based physical simulation is still going in each frame, during this
copying time, Node structure becomes unsynchronized with the client
data, causing unexpected bouncing.

The solution is copy data to the other vertex data store, while the
currrent one is still in use by simulation, when the copy is
complete, make the Node structure sync with the new vertex data
store.

Signed-off-by: plysan <plysab@gmail.com>
Terminate the program gracefully

Make sure the updater thread that is using mapped buffer is
terminated before delete the buffers.

Signed-off-by: plysan <plysab@gmail.com>