Optimize renew().

Don't call session_id() twice when we can use a local variable to store
the current session id.

Fixes #3531