Fix Atom.write().

For root, Mp4File, there is no header.
For other normal box, we need to check if it is leaf box or a box
containing children boxes. They should be dealt with in different
way.