smartcard: added missing defines for OS X
build: cleaned up and fixed PCSC detection