Fixes bitmask issue in index command header reading

observed behaviour would be that the next entry in the log would be
missing a couple of bytes in the beginning, most notably the log entry
version, so that command type would be read into log entry type field
and potentially throw exception saying "unknown entry[X]" or throw an
exception in the vicinity of such command in other interesting ways.
Merge pull request #2790 from tinwelint/2.2-fix-index-cmd-mask

Fixes bitmask issue in index command header reading