A proton synchrotron blazar model for flaring in Markarian 501