Clean up 'pkg' binary path location

Add a cross platform method to detect pkg binary path.

Reference: http://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby