Engine Exit and Exit Memory check

Added SDL filter for quit event to notify engine exit
Added an atexit function to check if all the memory has been released
Updated the samples with the atexit check