Fix indentation.
Use closefrom() on BSD.