The initial code for this fixed used rstrip incorrectly.
This implementation uses endswith and rindex instead
and should read a bit more easily.
Also added a unit test to test that 'deleted' exe's are
filtered correctly.
Fixes LP Bug #967931.
Change-Id: I1783a8e2d59edd35734673b23e295f5a0b80b988