Modified to listen for database events and clear current compilation results database is about to change in any way.
This fixes bug #3559257 (http://bit.ly/Qc8Fqu): Compile Results accessed from menu can get out of sync.
*** This is a similar fix to that made in trunk at r2244 but is a cruder solution because required database events for more refined solution are not available in v3.x.