Refactor the unit test for MemoryBuffer::getOpenFileSlice

Run in two different modes: with and without reopening the temporary file
between creating it and mapping it with MemoryBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186986 91177308-0d34-0410-b5e6-96231b3b80d8