A German burglar has escaped a prison sentence – because he suffers from a permanent erection.