This fixes a bug where closing and reopening a DB caused an error because the ops functions were pointing at old file descriptors.