p2pd: do not close an fd that is not open