Move implementation of closefrom(3) from app.c to strcompat.c