Update JSON coercer to safely coerce doubles

Use (safe double) for coercion, so the original value will be preserved and validated when coercion fails.