make pkg query returns EX_UNAVAILABLE when no package could be found.

pkg query exists 0 regardless if any package could be found. This patch
ensure to return a non-zero status (EX_UNAVAILABLE) when no package
could be found.