opkg: fix package state detection