It appears that no-one's too sure about this, according to the Metropolitan Police, anyway. Take a look at their website for possible derivations http://www.met.police.uk/history/oldbill.htm
The first time I ever heard it used (but perhaps I was naive) was on the T.V. about thirty years ago on the BBc when there was a play or film about a small gang of Children who had found an old copper boiler on the Thames foreshore and were takin it to a scrap metal merchant to raise some cash and some burly dockers took it off them and the kids threatened to call the "THE OLD BILL Law"