Fix DetachedInstanceError after StatusCodeRedirect

In certain cases, e.g. after an exception has been thrown, the database
session may be detached, but database objects managed by the orm are
still refered to from the same thread.

Such objects can be merged with the new db session, as described in
http://stackoverflow.com/a/9705458/201743

This is done with `c.user` which is re-retrieved from repoze.who after a
StatusCodeRedirect.

This fixes what ade22d799ebe894b1f7a9fbc3a5685e6aceca4e7 works around.

See also discussion on: https://bitbucket.org/phihag/hhu-
adhocracy/issue/168/error-handler-causes-is-not-bound-to-a
Merge branch 'develop' into feature-thumbnail_badges_#191_hierarchical_badge_#95
Fix facet item counts for facets with exclusive values

The solution to calculate facet item counts for facets with exclusive
values in 9e7c7c46568dd370019a61978655bac248ab21e9 was wrong and only
worked for simple cases.

The general solution in this commit instead does the following:

For each facet with exclusive values, create another solr query, which
is the same as the current main query (facet_query), but without the
filter on that same facet.

This would normally be done in solr with `LocalParams`, but this isn't
yet implemented in sunburnt (see tow/sunburnt#6). A workaround (as
described in the latter issue) would be possible if sunburnt would allow
to create multiple filter query parts instead of putting them together
in one filter query with `AND` constructs (see tow/sunburnt#37).
Avoid UnmappedInstanceError if c.user is None

Addendum to afa02732f672af01ef33dbaa1520beabdf577256
Fix many cancel urls for relative_urls case

Also, use some more useful cancel urls where appropriate.
Merge branch 'develop' into feature-thumbnail_badges_#191_hierarchical_badge_#95