Fix legend handle recovery on older MATLAB versions

Recover legend handles using tags on older MATLAB versions.
Use findobj instead of findall to ignore hidden handles.