termux-api: Cleanups and fix whitespace handling