(#1658) - integrate persistent mapreduce

This commit ensures that the persisted map/reduce
indexes are destroyed when their parent database
is destroyed.