Fix Trac #3717 by making exprOkForSpeculation a bit cleverer