lpclient.pl: move main code loop into a main() sub.

Makes it clearer that that's what it is!