WebSession: fix for login-with-referer issue

* With the recent introduction of lazy saving of sessions,
  a memory leak was somehow introduced and subsequently solved.
  However it looks like there is some corner case in which the
  user session object is not released, and hence not saved.
  This commit introduces explicit saving of sessions upon
  concluding serving a request. Additionally removes the __del__
  special method of the session object, thus improving the
  possibility for Python garbage collector to be able to correctly
  delete the session from memory when no longer explicitly
  referenced.

* Removes never used support for session locks.

* In order not to confuse Browser, avoid creating duplicate
  (session) cookies, by just recording, for each cookie name,
  what is the last cookie the code would like to send to the
  user and by just sending this last one to the client.
BibDocFile: explicit redirection to secure URL

* When authentication is needed in order to access a restricted
  document, explicitly redirect to CFG_SITE_SECURE_URL/youraccount/login.
  Redirecting to /youraccount/login only would in fact trigger bad
  authentication issues in case of multiple hostname aliases being
  used over HTTPS.
errorlib: register_exception improvements

* Improves traceback analysis of register_exception by correctly
  employing inspect.trace API.

* Removes truncation of prefix and suffix variables
  set in the source code, when registering an exception, since these
  are often used to clearly put in evidence the data source that
  caused an error.

* Explicitly deletes inspected frames as recommended in
  <http://docs.python.org/2/library/inspect.html#the-interpreter-stack>.
bibdocfile: better error report for unknown format

* When an unknown format for a bibdocfile is requested an exception
  was registered (and an email was sent to the admins), even when
  no referer was specified in the HTTP headers, thus cluttering
  error reports in case of malicious users playing with the system.
  This commit improves the check for unknown formats earlier avoiding
  the exception to be registered, when no referer is set.
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  bibdocfile: better error report for unknown format
WebAccess: admin interface usability improvement

* Improves usability of the WebAccess admin interface by providing
  a link from roles listed in the "Show Action Details" page back
  to the corresponding "Show Role Details".  (closes #933)
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  WebAccess: admin interface usability improvement
WebSubmit: fix the approval URL for publiline

* Replaces the deprecated approve.py URL to directly use the submission
  interface in order to approve or reject documents.  (related to
  RQF0166374)
WebSearch: next-hit/previous-hit numbering fix

* Fixes a next-hit/previous-hit numbering inconsistency when
  displaying multiple records with the HTML detailed format.
  (closes #1237)
installation: inclusion of JS quicktags in tarball

* Fixes problem of missing JS quicktags in release tarball introduced
  in 2232d96c911c1663639fc20ce0822064f4ba3608.
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  installation: inclusion of JS quicktags in tarball
Merge branch 'maint-1.1'

* maint-1.1:
  installation: inclusion of JS quicktags in tarball
  WebSearch: next-hit/previous-hit numbering fix
  WebSubmit: fix the approval URL for publiline
  WebAccess: admin interface usability improvement
  bibdocfile: better error report for unknown format
  errorlib: register_exception improvements
  BibDocFile: explicit redirection to secure URL
  WebSession: fix for login-with-referer issue
I18N: PO file update for the release of v1.0.4
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  I18N: PO file update for the release of v1.0.4
Merge branch 'maint-1.1'

* maint-1.1:
  I18N: PO file update for the release of v1.0.4
Invenio v1.0.4
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  Invenio v1.0.4

Conflicts:
	INSTALL
	Makefile.am
	RELEASE-NOTES
Merge branch 'maint-1.1'

* maint-1.1:
  Invenio v1.0.4
global: login link using absolute URL redirection

* When redirecting users to login page, consistenly use absolute
  URLs instead of relative ones. This solves bad authentication
  issues, in case of multiple hostnames used over HTTPS.
  Follows commit 19e1fb8.
Merge branch 'maint-1.1'

* maint-1.1:
  global: login link using absolute URL redirection

Conflicts:
	modules/bibcirculation/lib/bibcirculation_webinterface.py