return error when random port pool is empty

fixes #232