Use sys.exit when available

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
Signed-off-by: Octavio Alvarez <alvarezp@alvarezp.ods.org>
Only execute if called directly

Signed-off-by: Hector Acosta <hector.acosta@gmail.com>
Signed-off-by: Octavio Alvarez <alvarezp@alvarezp.ods.org>