Verify buf length during checking since the coinbase could have been truncated in GBT mode

Signed-off-by: Huang Le <4tarhl@gmail.com>