Choose lib vs lib64 according to architecture

Signed-off-by: Olaf Kirch <okir@suse.de>
Work on capturing stderr/stdout separately

Signed-off-by: Olaf Kirch <okir@suse.de>
improve the file mode handling

Signed-off-by: Olaf Kirch <okir@suse.de>