take: Support taking more items from a list than it has

When trying to take more elements from a list than it has, return as
many as possible, instead of bailing out with an exception.

Use itertools.islice for this job.

Reported-by: Paul Tagliamonte <paultag@debian.org>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
take: Simplify the code

We do not need the let outside, and using -> makes the flow easier to
understand too.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
tests: Remove an empty line.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>