Bayern survive St. Pauli scare to stay on course for title