system: Make which() testable

Previously which() used direct FS access, now the File class is used.
Additionally the method was changed to not raise an Exception if a cmd
was not found, instead None is returned.

Change-Id: I37081b4aa34ed3060f1503961d545eb7322bd4b3
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>