Fixed bug in main.cpp where ncurses would not be deallocated when exiting from an XnInterface init failure
Merged changes from master 6d3b8ac2