amunits: some random functions syscall-ified. Mostly things used by rtl-console and FV.

git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@28578 3ad0048d-3df7-0310-abae-a5850022a9f2