hoist boundary check code to the out of loop

Current implementation of sprintf(..., "%x",...) always execute boundary check. 
(e.g. https://github.com/h2o/qrintf/blob/master/share/qrintf/qrintf.h#L1321)

This pull request hoists this check to the out of loop to simplify main code of hexadecimal to string conversion.