test mongoose db connection state before open