Avoid writing bogus unitcell info to disk for trajs without PBCs

- [x] Add test that fails for the broken behavior
- [x] Fix behavior

cc #329 

The three formats with the bug are XTC, TRR and DCD.