Ularn code updated to build quietly on modern Linux

I've made some minor changes to gather (but not check) return values from calls to write(), fgets(), and system(), and changed "%d" to "%ld" in fprintf() where needed to completely eliminate warnings when building under Ubuntu 11.04/gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 

Tested with
 ./autogen.sh
 ./configure
 make

No warnings.