Bristol Bears secured a home semi-final tie with a narrow bonus-point win at Leicester Tigers at Mattioli Woods Welford Road.