Make std.range.recurrence safe if possible
Merge pull request #2778 from tom-tan/safe-range-recurrence

Make std.range.Recurrence safe