Various portability fixes

Michael Forney
2013-10-03T09:36:40Z

Hi,

These patches address various portability issues. They are needed to build
util-linux against musl libc.