Backport the following test from Bitcoin Core
```
commit a750d77b950175115fcab528fa0d3a2e0ffab96d
Author: John Newbery <john@johnnewbery.com>
Date: Thu Mar 9 17:14:55 2017 -0500
Add tests for mempool persistence
Adds tests for mempool persistence as well as for the new
-persistmempool command line parameter.
```