fix cuda::BufferPool deinitialization

The deinitialization of BufferPool internal objects is controled by global
object, but it depends on other global objects, which leads to errors
caused by undefined deinitialization order of global objects.

I merge global objects initialization into single class, which performs
initialization and deinitialization in correct order.
move StackAllocator to cpp file

it is internal class, no need to export it
fix null stream initialization for multi-gpu systems
Merge pull request #3523 from jet47:fix-cuda-buffer-pool