py, lexer: Add allocation policy config; return NULL if can't allocate.
stmhal: Improve handling of out-of-memory in REPL.

Addresses issue #558, but it's likely that other out-of-memory errors
could crash the pyboard.  Reason is that qstrs use m_new and can raise
an exception within the parser.
Merge branch 'master' of github.com:micropython/micropython