fix sizes of stack and buffer in shell

It is confusing that "ps" uses 2024-byte buffer while shell_task has only
512-byte stack.

TODO: Allocate memory with malloc/free & uxTaskGetNumberOfTasks to meet
      the actual requirement of vTaskList.
bump heap_1.c into heap_4.c

Reference: 2f026 from zzz0072/freertos/master
move memory-related functions into memory-util.c
add malloc/free into memory-util.c

Their implementation refers to heap_4.c
provide a ctype_table for __ctype_ptr__

Issue: The toolchain implements functions in ctype.h as macros, I.E.
       -ffreestanding does not disable them. It refers my ctype_table
       using index directly, so there may be memory access problems with
       arguments out of [-128, 255].

Reference: https://chromium.googlesource.com/native_client/nacl-newlib/+/master/newlib/libc/ctype/ctype_.c
let printf's output (null) for NULL strings
let printf's support %p

%p outputs (nil) when NULL is given.
use new parsing policy of printf's format

Specification of padding & width is considered (not implemented yet). It
can support format such as %02x in the near future.
implement basic layout handling of printf's

It handles layout such as "%02X", "%-3s".
put case-sensitive handling in utoa

Default case implementation is uppercase, and case conversion can be
triggered by setting lowercase parameter as nonzero.

Note: itoa has no freedom of case selection!
let printf's support %x
let recv_byte have two versions

If log is not NULL, it performs non-blocking input and stores pdTRUE or
pdFALSE to tell whether this call succeeds. On failure, its return value
is conceptually unexpected.

Reference: 06f06 from zzz0072/freertos/master
add rand/srand into random-util.c

Algorithm in rand() refers to hack-malloc.

Difference from prng():
1. Variable "bit" need not to be static.
2. State of prng() will no longer excceed 0xFFFF after the first such
   state appears. So, the return value itself represents its state
   without a 0xFFFF mask.

Issues:
1. The range of rand() is not [0, RAND_MAX] defined in stdlib.h
2. It always returns 0 when its state is set to 0.

References:
[1] git@github.com:embedded2013/hack-malloc.git
[2] http://en.wikipedia.org/wiki/Pseudorandom_number_generator
rewrite rand() using inline assembly

The structure refers to tim37021's naked attribute (rtenv also used it).
Usage of registers refers to zzz0072's inline assembly.

References:
[1] http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html
[2] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344c/Beiiegaf.html
[3] zzz0072/freertos/master
[4] tim37021/freertos/master