BUG: Use `np.where` in np.triu/np.tril, fixes #4859

Replaces the current method to zero items, from multiplication to
using `np.where`.