TS-1894 madvise() not found on Solaris. And some cleanup.