DWR rendering infrastructure: allow throwing custom exceptions

Allow rendering code to throw custom Exceptions, to be handled Javascript-side as
described here:

http://directwebremoting.org/dwr/documentation/browser/errors.html

This was needed in at-the-moment-downstream code and does not hurt to have it here.
Plus, it might be useful in future.
Refactoring: utility method makeAjaxCallback renamed

Name was not really appropriate, renamed to better distinguish from new
method to be added by next commits.
Safer DWR callback method introduced

We discovered a bug in DWR, still unresolved even on the project SVN, about
the error callback function being called when navigating away from a page
while an AJAX call is in progress.

This does not always happen, but it has been reproduced reliably on Firefox
28 and Chromium 33 on Linux and Firefox 28 on Mac OS X right after Tomcat
is restarted and especially in automated tests. Currently an error popup
appears briefly.

This commit adds a workaround by detecting page unloads and avoiding
error handler calls if the specific error is detected. It can be removed
once it is fixed by DWR upstream.
dwr.xml file reformatted