Patch for making getlastdocid work when the identifier is a large number
greater than can be encompassed by an int. Now it uses a long to
represent the number, which doesn't solve the problem but probably does
make it work for the vast majority of cases.