Ensure thread-safety of CachedOutputRouter and CachedStreamRouter.

Fixes #672.
Honor prefix configuration in LoggingOutput.
Merge branch 'master' of github.com:Graylog2/graylog2-server

Conflicts:
	graylog2-server/src/main/java/org/graylog2/outputs/CachedOutputRouter.java
	graylog2-server/src/main/java/org/graylog2/streams/CachedStreamRouter.java