Convert mapBlockIndex to class with RAII.

Store mapBlockIndex global map into custom class that frees the memory
on program shutdown using RAII.  This prevents false positives in memory
leak checks and is cleaner.