MDEV-6400: "ANALYZE SELECT ... INTO @var" doesn't set @var

Make ANALYZE work for
- ANALYZE SELECT ... INTO @var
- ANALYZE INSERT SELECT ...;
- ANALYZE SELECT .. INTO OUTFILE
Merge branch '10.1' of github.com:MariaDB/server into 10.1