Redirect properly AJAX POST requests when the session times out

No ChangeLog entry due to it applies to:

* Use uWSGI instead of Apache mod_perl for running CGIs
 Use window.location.replace instead of window.location.href

To redirect in JavaScript

Because replace() does not put the originating page
in the session history, meaning the user won't get stuck
in a never-ending back-button fiasco.
Merge pull request #1064 from Zentyal/ejhernandez/ajax-post-redir

Fix AJAX POST redirects when session times out