riemann: Fix the float-y metric casting code

When casting strings to float, correctly recognise when the casting
succeeds, and when it fails. This fixes #27.

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