For stm32f4discovery

Filling functions to enable standard input, timer, and low power mode.
Besides, fix error of exiting a thread.

* Implements hardware timer using TIM2 with capture and compare.
* Implements sleep mode with ``WFI``.
* Implements stdin with USART2 (uart initialization codes are in thirdparty_board repository).
* Make all context switch operating in PendSV.