bmf: do not close an fd that is not open