Match bitbake python3 port.
Sent first series of patches for review: https://lists.yoctoproject.org/pipermail/toaster/2016-May/004574.html
The fixes are under review now: https://lists.yoctoproject.org/pipermail/toaster/2016-June/004780.html
The fixes have been merged into poky master.