BUG: fix some xdmf writer crashes

- Sets the number of output ports to 0, which avoid an error message in
  Paraview because the writer is used in a pipeline.
- Manages a potential null pointer, avoiding a crash which occurs when the
  user unchecks some blocks in Paraview for instance.

Change-Id: I09c69bc6ac715bcb4297df4e2a012514a7817c57
Merge topic 'bug_xdmf_writer' into master

0679bf40 BUG: fix some xdmf writer crashes