Carlos Martinez survives nosebleed to beat Padres