Make ST_GeometryN check for GeometryCollections

Before, this worked:
```mysql
SELECT ST_GeometryN('LINESTRING(1 1, 1 6, 2 2, -1 2)', 1);
-- Answer: LINESTRING(1 1, 1 6, 2 2, -1 2)
```

Now the same request gives the following:
```mysql
SELECT ST_GeometryN('LINESTRING(1 1, 1 6, 2 2, -1 2)', 1);
-- Answer: NULL
```

Unit tests added, including a unit test checking for an out of range
index.