[leaseinfo] fix accidental closure of file pointers

When dumping leaseinfo data to a user supplied file pointer, allow
the user to determine if closing the fp is needed. This prevents,
among other problems, accidental closure of stdout.