#560 - Fix server config validation issues.

Fixes:

1. Test Email functionality in server configuration page.
2. Validate LDAP functionality in server configuration page.
3. Reload Command Repo Cache functionality in server configuration page.

All were broken because CSRF token was not being sent, and in Rails 4, even
AJAX requests are checked for CSRF. Wasn't the case with Rails 2.
> session is a hash-like object. I think it should be fine to read twice from it.

My only reason was that since we know how to short circuit the conditional, I thought we might as well do it. Considering point (2), I guess the effort does not justify the result. I'm ok living with this right now.