Onset of shear localization in viscoplastic solids