Refactor writeSignedAPTag and writeUnsignedAPTag

They were almost identical except for the tag number. Refactor them to
use writeIntegralTag.