Improve type inference for generic dot

Right now the type inference for the generic `dot` is not doing so well:
```
julia> Base.return_types(dot, (AbstractVector{Float64}, AbstractVector{Float64}))
2-element Array{Any,1}:
 Float64
 Any 
```
and it causes a significant penalty when working with views. E.g.
```
julia> using ArrayViews
julia> x = randn(10^7);xv = view(x, 1:length(x));
julia> @time dot(xv, xv);
elapsed time: 0.034378086 seconds (96 bytes allocated)
```
and with this pr
```
julia> using ArrayViews
julia> x = randn(10^7);xv = view(x, 1:length(x));
julia> @time dot(xv, xv);
elapsed time: 7.263e-6 seconds (96 bytes allocated)
```
no you want the ternary operator here