Counts command now always writes the command type header

and will not even exist as a command in the transaction if the delta was
0. This fixes a problem where the reader, always expecting a command type
after a command log entry header to be there, failing to read that
command.
Merge pull request #3119 from tinwelint/2.2-fix-count-cmd-header

[2.2] Counts command now always writes the command type header