Fix a bug about the written header size in EDFs
Thanks to Peter Bösecke who reported this bug.
Added test to prevent regression