Minor improvements to CardGenerator and the corresponding unit test

Make sure that the file gets closed when writing a card to/reading a
card from disk. Also add a unit test for the error condition when trying
to import a card from a non-existent file.
You removed `readDatagroups` from the CardGenerator. It previously allowed customizing the DGs of a MRTD like card (see https://github.com/frankmorgner/vsmartcard/blob/master/virtualsmartcard/npa-example-data/Example_Dataset_Mueller_Gertrud.txt for an example) Was this intended?