fileutils: perform ctypes function setup just the once

(integrated from trunk branch change dbd1933 by Todd Whiteman <toddw@activestate.com>)