Fix portability problems in ircd-patch script.