Python3 fix

Fixes build.
Added some cleanup to prepare for re-introduction of python package.

This is a follow-up on my previous pull request : https://github.com/openwrt/packages/pull/429