Characterisation and mitigation of beam-induced backgrounds observed in the ATLAS detector during the 2011 proton-proton run