Close file before doing munmap

This prevents a nasty crash on exit
Don't keep around a useless fd