Bangladesh have battled back after a batting collapse on the opening day of the first Test against South Africa, thanks to left-arm spinner Taijul Islam's 5-49.