Don't allocate more than is needed in BUF_strndup().