Use session rather than form key for captcha

Fixes #17811

Signed-off-by: Damien Regad <dregad@mantisbt.org>
Increase captcha public key max value

The captcha's public key was generated as a random number between 0 and
99999.

As per Alejo Popovici's recommendation in ~41918, this commit removes
the limitation in mt_rand() call, so the generated key is now a number
between 0 and mt_getrandmax() (2147483647 on my box).

Issue #17811