riemann: Rearrange the stream processing

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>