round doubles to i64s more carefully, especially small negatives; fixes #1539