Import fcntl rather than pieces from it
Remove print_function, change uses of it that were errors to stderr