Check that items exist in maps before returing them.
Free allocated memory if open fails.
Corrected return types for read/write.
Prevent compiler from optimising away syscalls.
Ensure environment variable exists before returning it.
getenv now returns length of variable.
Added implementation of newlib write() to allow writing to stdout.
Updated toolchain test program.