(#1658) - fix tests for persisted map/reduce

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