BUG: Fix corner cases in fromiter()

Tests added for short, long, empty and invalid sequences.