On pinning of superconducting flux lines by grain boundaries