The main sequence of star-forming galaxies - I. The local relation and its bending