objclosure: Fix printing of generator closures.

The code previously assumed that only functions can be closed over.
stream: Return errno value as first arg of OSError exception.

This is CPython-compatible convention established yet in acb13886fc837a1bb9.
stream: Handle non-blocking errors in readline() properly.

Just like they handled in other read*(). Note that behavior of readline()
in case there's no data when it's called is underspecified in Python lib
spec, implemented to behave as read() - return None.
py: Take gc_pool_start out of bss section, to reclaim 1st block of heap.
py: Fix compiling of nested while/for and exception handler.

Addresses issue #912.
py: Add more debug printing code in gc_dump_alloc_table.
tests: Add test for nested while with exc and break.
py: Simplify compilation of elif blocks.
py: Add more compiler optimisations for constant if/while conditions.
modure: Update to re1.5 v0.6.1, fixed and extended character class support.
py: Improve stream_read so it doesn't need to alloc 2 bits of heap.
unix: Make -c option parse input script as a file, as per CPython.

Addresses issue #915.
unix, stmhal: Implement file.readinto() method.

Also, usocket.readinto(). Known issue is that .readinto() should be available
only for binary files, but micropython uses single method table for both
binary and text files.
tools, pyboard.py: Allow exec argument to be bytes or str.
py: Partially fix viper multi-comparison; add test for it.
examples: Update conwaylife to work with new LCD API.
stmhal: Add retry to SD card init.

This fixed an issue with a certain SD card sometimes not initialising
first time round.  See issue #822 for related, and thanks to
@iabdalkader for the idea.
stmhal: Set entry point for ELF binary debugging

When loading the ELF binary to the board with a debugger, the debugger
needs to know at which point to start executing the code. Currently the
entry point defaults to the start of the .text section.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Implement kwargs for builtin open() and _io.FileIO

This makes open() and _io.FileIO() more CPython compliant.
The mode kwarg is fully iplemented.
The encoding kwarg is allowed but not implemented; mainly to allow
the tests to specify encoding for CPython, see #874
Use mode/encoding kwargs in io and unicode tests

mode argument is used to assert it works
encoding argument is used to make sure CPython uses the correct encoding
as it does not automatically use utf-8