Fixed a few cppcheck warnings.

C-style cast
Add function const to MemoryPoolAllocator::Capacity() and Size()