Thank you for all the replies: I hadn't seen the Canada entry on ancestry, so that was interesting. One of the entries appears to put him in the 1st Foot 4th Battalion, and one in the 3rd Foot 2nd Battalion which seems slightly odd.
My James was definitely the son of John Lloyd, miller; but he became a hatter in London and consistently gave his dob as c1798 (although he could have lied about his age when he joined up and his 1819 leaving does give him time to marry in December of that year), so this entry may turn out to be a cousin, given that there appears to be a William Lloyd, miller, also having children in Dunmow at the same time.
Three Lloyds (James, William and Cornelius) all left Dunmow at about the same time to become hatters in London, but I have yet to prove whether they are brothers, cousins or not related (or, indeed, why they became hatters rather than millers).
Richard