Unit.create: Fix wrong sequence_number in some rare circumstances of units/subunits

The bug occurred when the max "position" of units was lower than the max "position" of subunits.
NOTE: always evaluate the max "position" of units (or subunits) relative to the level.