Minor changes to compile with older versions of Linux/GCC.

Also updated the sc-hsm-ultra-sample.sh/.cmd convenience scripts to include logging. Deleted the old logging scripts. Locking of the log files themselves must now be done externally e.g. with pgrep under Linux.