utils: make le16 endian conversion functions work with arguments that have side effects