REVIEW: [NEXUS-6568] (2.9) Add CSRF protection via OWASP CsrfGuard 

https://issues.sonatype.org/browse/NEXUS-6568

Most of the code is copied from OWASP CrsfGuard. Changes are detailed in JavaDoc.