Cleaning up libc functions
Fix elf32 loading bug

If sections starts out of 4k alignment data is loaded with a wrong
offset. This change aligns new section allocation and memory write
properly according to elf file headers.
Fix deadlocks and clean up functions
Cleanup init