Replace memcpy with the cortex-strings implementation

Benchmarks on a Nexus 10 have shown this implementation to be
up to 12% faster.

Change-Id: I212df99357b338221779cfba118ebfff441c9457
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Add .cfi_startproc/.cfi_endproc wrapper to memcpy

Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
Fix pthread_detach for already-exited threads.

This fix handles the case when pthread_detach is
called for threads which have already exited.
This is required to avoid any memory leak

Change-Id: I2bf7f41234d93b226132a4c51705f4186f4961c3
Reported-by: Paresh Nakhe <pnakhe@codeaurora.org>