file: Fix import path in test. Fix closing of file descriptor.