keygen() should maintain its own index to append

This is to ensure that callbacks added for jsonp() have the
best chance of getting unique names.